%global forgeurl https://github.com/sorz/sstp-server %global version %(date +%Y%m%d) %global commit b10b38bf9bf0e0351e3e3422ed39b33f5e534981 %global _forgeversionsuffix %{scm}%(printf %.7s %{commit}) %global source_date_epoch_from_changelog 0 %forgemeta Name: sstp-server Version: %{forgeversion} Release: %{autorelease} Summary: SSTP VPN server License: MIT URL: %{forgeurl} Source0: %{forgesource} Source1: %{name}@.service Patch0: %{name}.patch BuildRequires: pkgconfig(python3) BuildRequires: python3dist(pip) BuildRequires: python3dist(setuptools) BuildRequires: gcc BuildRequires: systemd-rpm-macros Requires: ppp %description Secure Socket Tunneling Protocol VPN server. %prep %forgesetup %autopatch -p1 %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %check %pyproject_check_import %install %pyproject_install %pyproject_save_files sstpd %__install -p -m 755 -d -T %{buildroot}%{_sysconfdir}/sstp/server %__install -p -m 644 -D -t %{buildroot}%{_unitdir} %{SOURCE1} %__install -p -m 644 -D -t %{buildroot}%{_licensedir}/%{name} LICENSE %__install -p -m 644 -D -t %{buildroot}%{_pkgdocdir} README.rst %{name}.ini %post for UNIT in $(systemctl -P Id show %{name}@\*.service) do %systemd_post ${UNIT} done %preun for UNIT in $(systemctl -P Id show %{name}@\*.service) do %systemd_preun ${UNIT} done %postun for UNIT in $(systemctl -P Id show %{name}@\*.service) do %systemd_postun_with_restart ${UNIT} done %files -f %{pyproject_files} %license %{_licensedir}/* %doc %{_pkgdocdir} %{_sysconfdir}/* %{_unitdir}/* %{_bindir}/*