3 %bcond_with tests # build with tests
4 %bcond_without tests # build without tests
11 License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
13 # SF URL: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
14 # github URL https://github.com/USER/PROJECT/archive/v%{version}/%{name}-%{version}.tar.gz
15 Source0: %{name}-%{version}.tar.gz
19 #Patch0: %{name}-DESTDIR.patch
21 %if %{with initscript}
22 BuildRequires: rpmbuild(macros) >= 1.228
23 Requires(post,preun): /sbin/chkconfig
26 %if %{with systemd_service}
27 BuildRequires: rpmbuild(macros) >= 1.647
28 Requires(post,preun,postun): systemd-units >= 38
29 Requires: systemd-units >= 0.38
32 #BuildRequires: autoconf
33 #BuildRequires: automake
34 #BuildRequires: intltool
35 #BuildRequires: libtool
37 #Requires(pre,post): -
46 #ExclusiveArch: %{ix86}
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 %description -l pl.UTF-8
57 # noarch subpackages only when building with rpm5
58 %if "%{_rpmversion}" >= "5"
62 %description subpackage
64 %description subpackage -l pl.UTF-8
73 %description libs -l pl.UTF-8
76 Summary: Header files for %{name} library
77 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name}
78 Group: Development/Libraries
79 # if base package contains shared library for which these headers are
80 #Requires: %{name} = %{version}-%{release}
81 # if -libs package contains shared library for which these headers are
82 #Requires: %{name}-libs = %{version}-%{release}
85 Header files for %{name} library.
87 %description devel -l pl.UTF-8
88 Pliki nagłówkowe biblioteki %{name}.
91 Summary: Static %{name} library
92 Summary(pl.UTF-8): Statyczna biblioteka %{name}
93 Group: Development/Libraries
94 Requires: %{name}-devel = %{version}-%{release}
97 Static %{name} library.
99 %description static -l pl.UTF-8
100 Statyczna biblioteka %{name}.
105 #%setup -q -n %{name}
106 #%setup -q -n %{name}-%{version}.orig -a 1
110 #find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 %{__sed} -i -e 's,\r$,,'
112 # remove CVS control files
113 #find -name CVS -print0 | xargs -0 rm -rf
115 # you'll need this if you cp -a complete dir in source
116 # cleanup backups after patching
117 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
120 # if ac/am/* rebuilding is necessary, do it in this order and add
121 # appropriate BuildRequires
129 # if not running libtool or automake, but config.sub is too old:
130 #cp -f /usr/share/automake/config.sub .
135 # CFLAGS="%{rpmcflags}" \
136 # LDFLAGS="%{rpmldflags}"
138 %{?with_tests:%{__make} test}
141 rm -rf $RPM_BUILD_ROOT
142 # create directories if necessary
143 #install -d $RPM_BUILD_ROOT
144 %if %{with initscript}
145 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
147 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
150 DESTDIR=$RPM_BUILD_ROOT
153 rm -rf $RPM_BUILD_ROOT
156 %groupadd -g xxx %{name}
157 %useradd -u xxx -d /var/lib/%{name} -g %{name} -c "XXX User" %{name}
164 if [ "$1" = "0" ]; then
170 %post -p /sbin/ldconfig
171 %postun -p /sbin/ldconfig
174 %if %{with initscript}
176 /sbin/chkconfig --add %{name}
177 %service %{name} restart
180 if [ "$1" = "0" ]; then
181 %service -q %{name} stop
182 /sbin/chkconfig --del %{name}
186 %if %{with systemd_service}
188 %systemd_post %{name}.service
191 %systemd_preun %{name}.service
198 %defattr(644,root,root,755)
199 %doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO
202 # if _sysconfdir != /etc:
203 #%%dir %{_sysconfdir}
204 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
205 %attr(755,root,root) %{_bindir}/%{name}*
209 # initscript and its config
210 %if %{with initscript}
211 %attr(754,root,root) /etc/rc.d/init.d/%{name}
212 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
215 %if %{with systemd_service}
216 %{systemdunitdir}/%{name}.service
219 #%{_examplesdir}/%{name}-%{version}
221 %if %{with subpackage}
223 %defattr(644,root,root,755)
225 #%{_datadir}/%{name}-ext