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 using noarchpackage macro
22 #BuildRequires: rpmbuild(macros) >= 1.752
23 %if %{with initscript}
24 BuildRequires: rpmbuild(macros) >= 1.228
25 Requires(post,preun): /sbin/chkconfig
28 %if %{with systemd_service}
29 BuildRequires: rpmbuild(macros) >= 1.647
30 Requires(post,preun,postun): systemd-units >= 38
31 Requires: systemd-units >= 0.38
34 #BuildRequires: autoconf
35 #BuildRequires: automake
36 #BuildRequires: intltool
37 #BuildRequires: libtool
39 #Requires(pre,post): -
48 #ExclusiveArch: %{ix86}
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 %description -l pl.UTF-8
61 %description subpackage
63 %description subpackage -l pl.UTF-8
72 %description libs -l pl.UTF-8
75 Summary: Header files for %{name} library
76 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name}
77 Group: Development/Libraries
78 # if base package contains shared library for which these headers are
79 #Requires: %{name} = %{version}-%{release}
80 # if -libs package contains shared library for which these headers are
81 #Requires: %{name}-libs = %{version}-%{release}
84 Header files for %{name} library.
86 %description devel -l pl.UTF-8
87 Pliki nagłówkowe biblioteki %{name}.
90 Summary: Static %{name} library
91 Summary(pl.UTF-8): Statyczna biblioteka %{name}
92 Group: Development/Libraries
93 Requires: %{name}-devel = %{version}-%{release}
96 Static %{name} library.
98 %description static -l pl.UTF-8
99 Statyczna biblioteka %{name}.
104 #%setup -q -n %{name}
105 #%setup -q -n %{name}-%{version}.orig -a 1
109 #find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 %{__sed} -i -e 's,\r$,,'
111 # remove CVS control files
112 #find -name CVS -print0 | xargs -0 rm -rf
114 # you'll need this if you cp -a complete dir in source
115 # cleanup backups after patching
116 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
119 # if ac/am/* rebuilding is necessary, do it in this order and add
120 # appropriate BuildRequires
128 # if not running libtool or automake, but config.sub is too old:
129 #cp -f /usr/share/automake/config.sub .
134 # CFLAGS="%{rpmcflags}" \
135 # LDFLAGS="%{rpmldflags}"
137 %{?with_tests:%{__make} test}
140 rm -rf $RPM_BUILD_ROOT
141 # create directories if necessary
142 #install -d $RPM_BUILD_ROOT
143 %if %{with initscript}
144 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
146 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
149 DESTDIR=$RPM_BUILD_ROOT
152 rm -rf $RPM_BUILD_ROOT
155 %groupadd -g xxx %{name}
156 %useradd -u xxx -d /var/lib/%{name} -g %{name} -c "XXX User" %{name}
163 if [ "$1" = "0" ]; then
169 %post -p /sbin/ldconfig
170 %postun -p /sbin/ldconfig
173 %if %{with initscript}
175 /sbin/chkconfig --add %{name}
176 %service %{name} restart
179 if [ "$1" = "0" ]; then
180 %service -q %{name} stop
181 /sbin/chkconfig --del %{name}
185 %if %{with systemd_service}
187 %systemd_post %{name}.service
190 %systemd_preun %{name}.service
197 %defattr(644,root,root,755)
198 %doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO
201 # if _sysconfdir != /etc:
202 #%%dir %{_sysconfdir}
203 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
204 %attr(755,root,root) %{_bindir}/%{name}*
208 # initscript and its config
209 %if %{with initscript}
210 %attr(754,root,root) /etc/rc.d/init.d/%{name}
211 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
214 %if %{with systemd_service}
215 %{systemdunitdir}/%{name}.service
218 #%{_examplesdir}/%{name}-%{version}
220 %if %{with subpackage}
222 %defattr(644,root,root,755)
224 #%{_datadir}/%{name}-ext