Line 34: |
Line 34: |
| ==== %define version 1.0.0 ==== | | ==== %define version 1.0.0 ==== |
| ==== %define release 02 ==== | | ==== %define release 02 ==== |
| + | |
| ==== Version: %{version} ==== | | ==== Version: %{version} ==== |
− | ==== Release: %{release} ==== | + | ==== Release: %{release}%{?dist} ==== |
| | | |
| # The copyright should be "GPL" for any contrib module you hope to | | # The copyright should be "GPL" for any contrib module you hope to |
| # make available for other SME Server users | | # make available for other SME Server users |
| + | |
| ==== Copyright: GPL ==== | | ==== Copyright: GPL ==== |
| | | |
Line 134: |
Line 136: |
| | | |
| ==== %prep ==== | | ==== %prep ==== |
| + | |
| ==== %setup ==== | | ==== %setup ==== |
| ===== %patch0 -p1 ===== | | ===== %patch0 -p1 ===== |
Line 143: |
Line 146: |
| | | |
| ==== %build ==== | | ==== %build ==== |
| + | # A cool way for creating a directory called '''tmp''' during the rpm installation |
| + | =====%{__mkdir_p} root/var/lib/packageName/tmp===== |
| + | or |
| + | %{__mkdir} -p $RPM_BUILD_ROOT/var/log/httpd-bkpc |
| + | |
| ===== perl createlinks ===== | | ===== perl createlinks ===== |
| | | |
Line 152: |
Line 160: |
| # refer to the directory rpms/BUILD/yourappname/root (or whatever's set | | # refer to the directory rpms/BUILD/yourappname/root (or whatever's set |
| # in the BuildRoot line near the top of this spec file. | | # in the BuildRoot line near the top of this spec file. |
| + | |
| ==== %install ==== | | ==== %install ==== |
| # clean out the build root, to make sure nothing old is hanging around | | # clean out the build root, to make sure nothing old is hanging around |
Line 157: |
Line 166: |
| # now we generate a file list so we know what's in the RPM; see the | | # now we generate a file list so we know what's in the RPM; see the |
| # %files section below for how it's actually used | | # %files section below for how it's actually used |
| + | # A you can see below we set permissions and ownership on files and directories |
| + | # You can also ignore adding a directory with --ignoredir |
| | | |
| rm -rf $RPM_BUILD_ROOT | | rm -rf $RPM_BUILD_ROOT |
| + | rm -f %{name}-%{version}-filelist |
| (cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) | | (cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) |
− | /bin/rm -f %{name}-%{version}-filelist | + | /sbin/e-smith/genfilelist \ |
− | /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist
| + | '''--dir /var/lib/packageName/tmp 'attr(0770,root,www)' \''' |
| + | --dir /var/service/tinydns 'attr(0755,root,root)' \ |
| + | --dir /var/service/tinydns/log 'attr(0755,root,root)' \ |
| + | --file /var/service/tinydns/run 'attr(0750,root,root)' \ |
| + | --file /var/service/tinydns/tinydns-log.pl 'attr(0750,root,root)' \ |
| + | --file /var/service/tinydns/tinydns-readstats 'attr(0750,root,root)' \ |
| + | --file /var/service/tinydns/control/1 'attr(0750,root,root)' \ |
| + | --file /var/service/tinydns/control/2 'attr(0750,root,root)' \ |
| + | --file /var/service/tinydns/log/run 'attr(0750,root,root)' \ |
| + | --dir /var/log/tinydns 'attr(02755,dnslog,dnslog)' \ |
| + | --file /var/service/dhcp-dns/dhcp-dns 'attr(0750,root,root)' \ |
| + | --file /var/service/dhcp-dns/run 'attr(0750,root,root)' \ |
| + | --ignoredir /etc/sudoers.d \ |
| + | $RPM_BUILD_ROOT > %{name}-%{version}-%{release}-filelist |
| | | |
− | # This section will help clear out the build root before | + | # we can push file to a destination in order to use them after in a mysql.init script |
− | # building the RPM | + | # the file needs to be outside of the root/ of your rpm |
| + | # for example : |
| + | # my $dbstruct = `rpm -qd smeserver-packageName | grep packageName.sql`; |
| + | # /usr/bin/mysql $db < $dbstruct |
| | | |
− | ==== %clean ====
| + | echo "%doc CHANGELOG.git" >> %{name}-%{version}-filelist |
− | rm -rf $RPM_BUILD_ROOT | + | echo "%doc packageName.sql" >> %{name}-%{version}-filelist |
| | | |
| # Now we have to list all the files that are part of our installed RPM | | # Now we have to list all the files that are part of our installed RPM |
Line 182: |
Line 210: |
| # owned by user and group root | | # owned by user and group root |
| | | |
− | %defattr(-,root,root)
| + | ====%defattr(-,root,root)==== |
− | %attr(755,root,root) /etc/e-smith/sql/init/sme8admin
| + | ====%attr(755,root,root) /etc/e-smith/sql/init/sme8admin==== |
| + | |
| + | # This section will help clear out the build root before |
| + | # building the RPM |
| + | |
| + | ==== %clean ==== |
| + | rm -rf $RPM_BUILD_ROOT |
| | | |
| # The preun section lists commands to run prior to uninstalling the software | | # The preun section lists commands to run prior to uninstalling the software |
Line 200: |
Line 234: |
| # events or running action scripts | | # events or running action scripts |
| ==== %pre ==== | | ==== %pre ==== |
| + | /sbin/e-smith/create-system-user dns 53 "Name server" /var/service/tinydns /bin/false |
| + | /sbin/e-smith/create-system-user dnslog 411 "DNS log user" /var/log /bin/false |
| | | |
| # The post section lists commands to run after installing the software | | # The post section lists commands to run after installing the software |
| # on the e-smith system. This may mean things like signalling e-smith | | # on the e-smith system. This may mean things like signalling e-smith |
| # events or running action scripts | | # events or running action scripts |
| + | |
| ==== %post ==== | | ==== %post ==== |
| | | |