]> git.pld-linux.org Git - packages/python-dkimpy-milter.git/blob - python-dkimpy-milter.spec
- fix paths, init script, allow only python 2 or 3 not both, still NFY
[packages/python-dkimpy-milter.git] / python-dkimpy-milter.spec
1 #
2 # Conditional build:
3 %bcond_with     tests   # unit tests
4 %bcond_with     python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %if %{with python3}
8 %undefine with_python2
9 %endif
10
11 # NOTES:
12 # - 'module' should match the Python import path (first component?)
13 # - 'egg_name' should equal to Python egg name
14 # - 'pypi_name' must match the Python Package Index name
15 %define         module          dkimpy-milter
16 Summary:        DKIM signing and verification milter
17 Name:           python-%{module}
18 Version:        1.2.2
19 Release:        0.2
20 License:        BSD-like
21 Group:          Libraries/Python
22 Source0:        https://files.pythonhosted.org/packages/source/d/dkimpy-milter/%{module}-%{version}.tar.gz
23 # Source0-md5:  dc0f054bc7dc6178eb31f20d93b73cca
24 Source1:        dkimpy-milter.init
25 Patch0:         paths.patch
26 URL:            https://launchpad.net/dkimpy-milter
27 %if %{with python2}
28 BuildRequires:  python-modules >= 1:2.5
29 BuildRequires:  python-setuptools
30 %if %{with tests}
31 BuildRequires:  python-PyNaCl
32 BuildRequires:  python-aiodns
33 BuildRequires:  python-authres
34 BuildRequires:  python-dns >= 1.16
35 BuildRequires:  python-pymilter
36 %endif
37 %endif
38 %if %{with python3}
39 BuildRequires:  python3-modules >= 1:3.2
40 BuildRequires:  python3-setuptools
41 %if %{with tests}
42 BuildRequires:  python3-PyNaCl
43 BuildRequires:  python3-aiodns
44 BuildRequires:  python3-authres
45 BuildRequires:  python3-dns >= 1.16
46 BuildRequires:  python3-pymilter
47 %endif
48 %endif
49 BuildRequires:  rpm-pythonprov
50 BuildRequires:  rpmbuild(macros) >= 1.714
51 Requires:       python-modules >= 1:2.5
52 Requires:       python-setuptools
53 Conflicts:      python3-dkimpy-milter
54 BuildArch:      noarch
55 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57 %description
58 DKIM signing and verification milter.
59
60 %package -n python3-%{module}
61 Summary:        DKIM signing and verification milter
62 Group:          Libraries/Python
63 Requires:       python3-modules >= 1:3.2
64 Requires:       python3-setuptools
65 Conflicts:      python-dkimpy-milter
66
67 %description -n python3-%{module}
68 DKIM signing and verification milter
69
70 %prep
71 %setup -q -n %{module}-%{version}
72 %patch0 -p1
73
74 %build
75 %if %{with python2}
76 %py_build %{?with_tests:test}
77 %endif
78
79 %if %{with python3}
80 %py3_build %{?with_tests:test}
81 %endif
82
83 %install
84 rm -rf $RPM_BUILD_ROOT
85
86 install -d $RPM_BUILD_ROOT/etc/{dkimpy-milter,rc.d/init.d}
87 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dkimpy-milter
88
89 %if %{with python2}
90 %py_install
91
92 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
93 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
94 %py_postclean
95 %endif
96
97 %if %{with python3}
98 %py3_install
99 %endif
100
101 %clean
102 rm -rf $RPM_BUILD_ROOT
103
104 %post
105 /sbin/chkconfig --add dkimpy-milter
106 %service dkimpy-milter restart
107
108 %preun
109 if [ "$1" = "0" ]; then
110         %service dkimpy-milter stop
111         /sbin/chkconfig --del dkimpy-milter
112 fi
113
114 %post -n python3-%{module}
115 /sbin/chkconfig --add dkimpy-milter
116 %service dkimpy-milter restart
117
118 %preun -n python3-%{module}
119 if [ "$1" = "0" ]; then
120         %service dkimpy-milter stop
121         /sbin/chkconfig --del dkimpy-milter
122 fi
123
124 %if %{with python2}
125 %files
126 %defattr(644,root,root,755)
127 %doc README.md
128 %attr(754,root,root) /etc/rc.d/init.d/dkimpy-milter
129 %attr(755,root,root) %{_bindir}/dkimpy-milter
130 %{_mandir}/man5/dkimpy-milter.conf.5*
131 %{_mandir}/man8/dkimpy-milter.8*
132 %{py_sitescriptdir}/dkimpy_milter
133 %{py_sitescriptdir}/dkimpy_milter-%{version}-py*.egg-info
134 %endif
135
136 %if %{with python3}
137 %files -n python3-%{module}
138 %defattr(644,root,root,755)
139 %doc README.md
140 %attr(754,root,root) /etc/rc.d/init.d/dkimpy-milter
141 %attr(755,root,root) %{_bindir}/dkimpy-milter
142 %{_mandir}/man5/dkimpy-milter.conf.5*
143 %{_mandir}/man8/dkimpy-milter.8*
144 %{py3_sitescriptdir}/dkimpy_milter
145 %{py3_sitescriptdir}/dkimpy_milter-%{version}-py*.egg-info
146 %endif
This page took 0.310242 seconds and 3 git commands to generate.