Changes

From SME Server
Jump to navigationJump to search
305 bytes removed ,  21:44, 1 October 2014
no edit summary
Line 136: Line 136:     
==== %setup ====
 
==== %setup ====
==== %patch0 -p1 ====
+
===== %patch0 -p1 =====
    
  # The build section lists commands to run as part of the build process
 
  # The build section lists commands to run as part of the build process
Line 144: Line 144:     
==== %build ====
 
==== %build ====
====%{__mkdir_p} root/var/lib/packageName/tmp====
+
===== perl createlinks =====
# A cool way to create a directory called '''tmp''' even if it doesn't exist
  −
# in the upstream rpm.
  −
 
  −
==== perl createlinks ====
      
  # The install section lists commands to run during the build phase to
 
  # The install section lists commands to run during the build phase to
Line 157: Line 153:  
  # 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 165: Line 160:     
  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)
  /sbin/e-smith/genfilelist \
+
  /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
    '''--dir /var/lib/packageName/tmp 'attr(0770,root,www)' \'''
   
     --dir /var/service/tinydns 'attr(0755,root,root)' \
 
     --dir /var/service/tinydns 'attr(0755,root,root)' \
 
     --dir /var/service/tinydns/log 'attr(0755,root,root)' \
 
     --dir /var/service/tinydns/log 'attr(0755,root,root)' \
Line 180: Line 173:  
     --file /var/service/dhcp-dns/dhcp-dns 'attr(0750,root,root)' \
 
     --file /var/service/dhcp-dns/dhcp-dns 'attr(0750,root,root)' \
 
     --file /var/service/dhcp-dns/run 'attr(0750,root,root)' \
 
     --file /var/service/dhcp-dns/run 'attr(0750,root,root)' \
# A you can see above we set permissions and ownership on files and directories
+
     > %{name}-%{version}-%{release}-filelist
     $RPM_BUILD_ROOT > %{name}-%{version}-%{release}-filelist
   
  # This section will help clear out the build root before
 
  # This section will help clear out the build root before
 
  # building the RPM
 
  # building the RPM
echo "%doc CHANGELOG.git" >> %{name}-%{version}-filelist
+
 
  echo "%doc phpmyadmin.sql" >> %{name}-%{version}-filelist
+
==== %clean ====
  # we can push file to a destination in order to use them after in a mysql.init script for example
+
  rm -rf $RPM_BUILD_ROOT
 +
 
 +
  # Now we have to list all the files that are part of our installed RPM
 +
# The %files statement lets us refer to an external file list that we
 +
# just generated, which is easier than trying to list them all by hand
    
==== %files -f %{name}-%{version}-filelist ====
 
==== %files -f %{name}-%{version}-filelist ====
Line 197: Line 193:  
  # 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
    
  # 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 209: Line 205:  
  # on the SME Server. This may mean things like signalling events or
 
  # on the SME Server. This may mean things like signalling events or
 
  # running action scripts
 
  # running action scripts
   
==== %postun ====
 
==== %postun ====
  

Navigation menu