Hello-
I am familiar with packaging for other *nixes but this is my first RPM attempt and I have a couple of questions. I have read the various packaging docs on the Fedora Project site, but have been unable to find a precise answer. If there is another document to read or another list where I should be directing these questions, please let me know.
1. The Makefile sets PREFIX to /usr/local. In %install, is it ok to use:
make install PREFIX=/usr DESTDIR=$RPM_BUILD_ROOT
2. The Makefile also attempts to install and set user/group ownership and permissions, i.e. it does 'INSTALLBIN= install -g bin -o root -m 555'. Is it ok to address this by patching the line so it reads 'INSTALLBIN= install' seeing as how ownership and permissions are later set in %files?
3. Similarly, the Makefile also hardcodes the manpage directory, i.e. in install, it has: '$(INSTALLDIR) $(DESTDIR)$(PREFIX)/man/man1. Again, is it ok to patch this line so it reads '$(INSTALLDIR) $(DESTDIR)$PREFIX/share/man/man1'? This package has no ./configure stage and just uses make and make install, and does not appear to respect MANDIR.
I have done all these in my draft spec file and the package clears rpmlint and builds fine with mock, but I wanted to know if what I did followed convention.
Thanks!
On Mon, Jun 15, 2009 at 6:35 PM, Chess Griffin wrote:
Hello-
I am familiar with packaging for other *nixes but this is my first RPM attempt and I have a couple of questions. I have read the various packaging docs on the Fedora Project site, but have been unable to find a precise answer. If there is another document to read or another list where I should be directing these questions, please let me know.
- The Makefile sets PREFIX to /usr/local. In %install, is it ok
to use:
make install PREFIX=/usr DESTDIR=$RPM_BUILD_ROOT
Yes, but don't forget to use macros, e.g. in %install make install PREFIX=%{_prefix} DESTDIR=$RPM_BUILD_ROOT
- The Makefile also attempts to install and set user/group ownership
and permissions, i.e. it does 'INSTALLBIN= install -g bin -o root -m 555'. Is it ok to address this by patching the line so it reads 'INSTALLBIN= install' seeing as how ownership and permissions are later set in %files?
This one depends on the package and files being installed. Normally, directories and executables get 755, symlinks get 777 and the rest gets 644. However, there are (as always) exemptions. Meanwhile, please use at least INSTALLBIN="install -p" to preserve timestamps.
- Similarly, the Makefile also hardcodes the manpage directory, i.e.
in install, it has: '$(INSTALLDIR) $(DESTDIR)$(PREFIX)/man/man1. Again, is it ok to patch this line so it reads '$(INSTALLDIR) $(DESTDIR)$PREFIX/share/man/man1'?
Yes. Or even better, you can define a MANDIR variable and use it instead. This way you can also upstream the patch and after that you won't need to use an extra patch in the next releases.
Orcan
On 06/16/2009 01:35 AM, Chess Griffin wrote:
Hello-
I am familiar with packaging for other *nixes but this is my first RPM attempt and I have a couple of questions. I have read the various packaging docs on the Fedora Project site, but have been unable to find a precise answer. If there is another document to read or another list where I should be directing these questions, please let me know.
- The Makefile sets PREFIX to /usr/local. In %install, is it ok
to use:
make install PREFIX=/usr DESTDIR=$RPM_BUILD_ROOT
yes, it is perfect
- The Makefile also attempts to install and set user/group ownership
and permissions, i.e. it does 'INSTALLBIN= install -g bin -o root -m 555'. Is it ok to address this by patching the line so it reads 'INSTALLBIN= install' seeing as how ownership and permissions are later set in %files?
Better option is to use "install -p", in order to preserve any timestamps that might be otherwise affected.
- Similarly, the Makefile also hardcodes the manpage directory, i.e.
in install, it has: '$(INSTALLDIR) $(DESTDIR)$(PREFIX)/man/man1. Again, is it ok to patch this line so it reads '$(INSTALLDIR) $(DESTDIR)$PREFIX/share/man/man1'?
rpm defines a macro named %_mandir: [wolfy@wolfy2 ~]$ rpm -E "%_mandir" /usr/share/man In your case the patch should insert $(DESTDIR)/%_mandir/man1
On 06/16/2009 02:03 AM, Manuel Wolfshant wrote:
On 06/16/2009 01:35 AM, Chess Griffin wrote:
Hello-
I am familiar with packaging for other *nixes but this is my first RPM attempt and I have a couple of questions. I have read the various packaging docs on the Fedora Project site, but have been unable to find a precise answer. If there is another document to read or another list where I should be directing these questions, please let me know.
- The Makefile sets PREFIX to /usr/local. In %install, is it ok
to use:
make install PREFIX=/usr DESTDIR=$RPM_BUILD_ROOT
yes, it is perfect
Actually I was wrong, Orcan was right here ( do not use /usr but the macro)
On Tue, 16 Jun 2009 02:03:57 +0300 Manuel Wolfshant wolfy@nobugconsulting.ro wrote:
On 06/16/2009 01:35 AM, Chess Griffin wrote:
Hello-
I am familiar with packaging for other *nixes but this is my first RPM attempt and I have a couple of questions. I have read the various packaging docs on the Fedora Project site, but have been unable to find a precise answer. If there is another document to read or another list where I should be directing these questions, please let me know.
- The Makefile sets PREFIX to /usr/local. In %install, is it ok
to use:
make install PREFIX=/usr DESTDIR=$RPM_BUILD_ROOT
yes, it is perfect
- The Makefile also attempts to install and set user/group
ownership and permissions, i.e. it does 'INSTALLBIN= install -g bin -o root -m 555'. Is it ok to address this by patching the line so it reads 'INSTALLBIN= install' seeing as how ownership and permissions are later set in %files?
Better option is to use "install -p", in order to preserve any timestamps that might be otherwise affected.
- Similarly, the Makefile also hardcodes the manpage directory,
i.e. in install, it has: '$(INSTALLDIR) $(DESTDIR)$(PREFIX)/man/man1. Again, is it ok to patch this line so it reads '$(INSTALLDIR) $(DESTDIR)$PREFIX/share/man/man1'?
rpm defines a macro named %_mandir: [wolfy@wolfy2 ~]$ rpm -E "%_mandir" /usr/share/man In your case the patch should insert $(DESTDIR)/%_mandir/man1
Orcan and Manuel,
Thank you both for the excellent suggestions. I have incorporated all of your suggestions on the macros, timestamp preservation, and reworked the patch for MANDIR so it's something I can send upstream.
Many thanks again for the helpful advice.
packaging@lists.fedoraproject.org