Re: RPM build file

From: Dave Hill (dave@minnie.demon.co.uk)
Date: Wed Feb 23 2000 - 03:30:01 PST

  • Next message: Peter Kirchgessner: "Re: HP ScanJet 3C...it's working now"

    Petter Reinholdtsen wrote:
    >
    > [Dave Hill]
    > > I have an RPM build file to build sane if anyone is interested in
    > > adding it to the CVS for me.
    >
    > Sounds good to me. Post the file and the patch to the list so we can
    > have a look at it.

    attached

    > Will you be building RPMs when the new release is done?

    Can do (for i386 only!). They should then be transferred to the
    ftp site.

    > > It requires a simple patch to the Makefile.in files to allow a
    > > variable $(DESTDIR) to be prepended to all the install paths whilst
    > > building the binary RPM.
    >
    > I believe the normal GNU autoconf name for this variable is $(prefix).

    It's not quite the same as $(prefix). $(prefix) says where the s/w
    is to be installed so that, for example, the correct paths can be
    included in executables. The RPM build process requires that the
    software be "dummy installed" into (normally) /var/tmp/<package>
    and then the RPM file is built from that for later installation.

    So, as is in the rpm file attached, configure is run with the options

    --prefix=/usr --sysconfdir=/etc --datadir=/usr/share/sane

    but then needs to be "installed" in /var/tmp/sane/...

    This is normally done in RPM packages by setting a $(DESTDIR)
    variable which is picked up by the install Makefile.

    The RPM spec file attached is the one I used to build from my
    CVS tree dated 2000/02/20, hence the odd version number!

    Dave

    -- 
    Dave Hill, Kempston, Bedford UK		dave@minnie.demon.co.uk
    Sicth munce ago, I cutn't evun spel enjuneer, and now I are one!
    
    

    Summary: Scanner Access Now Easy %define name sane %define version 1.0.1.20000220 Name: %{name} Version: %{version} Release: 1 Group: Applications/Multimedia Source: ftp://ftp.mostang.com/pub/sane/%{name}-%{version}.tar.gz Patch1: %{name}-rhmakefile.patch Copyright: GPL BuildRoot: /var/tmp/%{name}-%{version}-root Packager: Dave Hill <dave@minnie.demon.co.uk> URL: http://www.mostang.com/sane

    %description SANE - Scanner Access Now Easy.

    SANE stands for "Scanner Access Now Easy" and is an application programming interface (API) that provides standardized access to any raster image scanner hardware (flatbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.).

    This package contains the SANE backends (drivers for scanners etc), the API itself and some frontends (user programs) for using SANE.

    If you want to build additional applications against SANE, you will also need to install the sane-devel package.

    %package devel Summary: Development files for applications which use SANE. Group: Development/Libraries Requires: sane = %{version}

    %description devel This package contains the SANE C libraries and header files. These development files will simplify the process of writing programs which use SANE.

    This package should be installed if you want to develop or build programs that need the SANE C libraries and header files.

    %prep %setup -q %patch1 -p 1 -b .rhmakefile

    %build # Debug version #CFLAGS="-g $RPM_OPT_FLAGS" ./configure --prefix=/usr --sysconfdir=/etc --datadir=/usr/share/sane # non-debug version CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --sysconfdir=/etc --datadir=/usr/share/sane make

    %install rm -rf $RPM_BUILD_ROOT

    make DESTDIR="$RPM_BUILD_ROOT" install

    # Build documentation for the %doc directive so that we don't end up # with everything in one directory.

    rm -rf .doc mkdir .doc mkdir .doc/frontend cp frontend/xcam.README .doc/frontend mkdir .doc/tools cp tools/README .doc/tools mkdir .doc/backend cp backend/*.desc .doc/backend cp backend/GUIDE .doc/backend cp backend/djpeg.README .doc/backend cp backend/hp.README .doc/backend cp backend/hp.TODO .doc/backend cp backend/umax.BUGS .doc/backend cp backend/umax.CHANGES .doc/backend cp backend/umax.FAQ backend/umax.TODO .doc/backend cp -r doc .doc/doc rm -f .doc/doc/*.man rm -f .doc/doc/*.5 rm -f .doc/doc/*.1 rm -f .doc/doc/Makefile* rm -rf .doc/doc/CVS

    %clean rm -rf $RPM_BUILD_ROOT

    %post ldconfig

    %postun ldconfig

    %files %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog LEVEL2 LICENSE NEWS PROBLEMS PROJECTS %doc README TODO # Copy our prepared doc directories. %doc .doc/frontend %doc .doc/backend %doc .doc/doc

    /usr/bin/find-scanner /usr/bin/scanimage /usr/bin/xcam /usr/bin/xscanimage /usr/sbin/saned %dir /usr/lib/sane /usr/lib/*.so* /usr/lib/sane/*.so* /usr/man/man1/* /usr/man/man5/* %dir /usr/share/sane /usr/share/sane/sane-style.rc %dir /etc/sane.d %config /etc/sane.d/*

    %files devel %defattr(-,root,root) /usr/bin/sane-config %dir /usr/include/sane /usr/include/sane/* /usr/lib/*.a /usr/lib/sane/*.a # Are these needed? #/usr/lib/*.la #/usr/lib/sane/*.la

    diff -ur sane-devel-20000123.orig/Makefile.in sane-devel-20000123/Makefile.in --- sane-devel-20000123.orig/Makefile.in Mon Aug 9 19:05:39 1999 +++ sane-devel-20000123/Makefile.in Wed Jan 26 13:49:43 2000 @@ -20,6 +20,8 @@ includedir = @includedir@ oldincludedir = /usr/include +DESTDIR = + MKDIR = $(top_srcdir)/mkinstalldirs INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -38,10 +40,10 @@ install: install-recursive - $(MKDIR) $(includedir)/sane + $(MKDIR) $(DESTDIR)$(includedir)/sane @list="$(INSTALLED_INCLUDES)"; for file in $$list; do \ - echo installing $${file} in $(includedir)/sane...; \ - $(INSTALL_DATA) $${file} $(includedir)/sane || exit 1; \ + echo installing $${file} in $(DESTDIR)$(includedir)/sane...; \ + $(INSTALL_DATA) $${file} $(DESTDIR)$(includedir)/sane || exit 1; \ done clean: clean-recursive diff -ur sane-devel-20000123.orig/backend/Makefile.in sane-devel-20000123/backend/Makefile.in --- sane-devel-20000123.orig/backend/Makefile.in Sun Jan 23 14:50:48 2000 +++ sane-devel-20000123/backend/Makefile.in Wed Jan 26 14:01:11 2000 @@ -22,6 +22,8 @@ oldincludedir = /usr/include configdir = ${sysconfdir}/sane.d +DESTDIR = + V_MAJOR = @V_MAJOR@ V_MINOR = @V_MINOR@ V_REV = @V_REV@ @@ -87,16 +89,16 @@ all: $(LIBS) libsane.la install: - $(MKDIR) $(libdir) $(libsanedir) $(configdir) + $(MKDIR) $(DESTDIR)$(libdir) $(DESTDIR)$(libsanedir) $(DESTDIR)$(configdir) @list="$(LIBS)"; for be in $$list; do \ - echo installing $${be} in $(libsanedir)...; \ - $(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) $${be} $(libsanedir)/$${be} \ + echo installing $${be} in $(DESTDIR)$(libsanedir)...; \ + $(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) $${be} $(DESTDIR)$(libsanedir)/$${be} \ || exit 1; \ done - @$(LIBTOOL) $(MINST) --finish $(libsanedir) + @$(LIBTOOL) $(MINST) --finish $(DESTDIR)$(libsanedir) @# Assume the dll name without any versions is last @dllend=`grep library_names= libsane-dll.la |rev|cut -d" " -f1|rev|sed 's/libsane-dll.//'|cut -d\' -f1`; \ - list="$(ALL_BACKENDS)"; cd $(libsanedir) && for be in $$list; do \ + list="$(ALL_BACKENDS)"; cd $(DESTDIR)$(libsanedir) && for be in $$list; do \ file=libsane-$${be}.$$dllend.$(V_MAJOR); \ lib=`grep dlname= libsane-$${be}.la | cut -f2 -d"'"`; \ if test ! -f $${file} -a -n "$${lib}"; then \ @@ -105,22 +107,22 @@ done @# Assume the dll name without any versions is last @dllend=`grep library_names= libsane-dll.la |rev|cut -f1 -d" "|rev|sed 's/libsane-dll.//'|cut -f1 -d\'`; \ - rm -f $(libdir)/libsane.a $(libdir)/libsane.$$dllend \ - $(libdir)/libsane.$$dllend.$(V_MAJOR)*; \ - $(LN_S) sane/libsane-dll.a $(libdir)/libsane.a; \ - $(LN_S) sane/libsane-dll.$$dllend $(libdir)/libsane.$$dllend ; \ - cd $(libsanedir) && for n in libsane-dll.$$dllend.$(V_MAJOR)*; do \ + rm -f $(DESTDIR)$(libdir)/libsane.a $(DESTDIR)$(libdir)/libsane.$$dllend \ + $(DESTDIR)$(libdir)/libsane.$$dllend.$(V_MAJOR)*; \ + $(LN_S) sane/libsane-dll.a $(DESTDIR)$(libdir)/libsane.a; \ + $(LN_S) sane/libsane-dll.$$dllend $(DESTDIR)$(libdir)/libsane.$$dllend ; \ + cd $(DESTDIR)$(libsanedir) && for n in libsane-dll.$$dllend.$(V_MAJOR)*; do \ nn=`echo $$n | sed 's,^libsane-dll,libsane,'`; \ (cd ..; $(LN_S) sane/$$n $$nn); \ done || exit 1 - $(INSTALL_PROGRAM) libsane.la $(libdir)/libsane.la + $(INSTALL_PROGRAM) libsane.la $(DESTDIR)$(libdir)/libsane.la @list="$(CONFIGS)"; for cfg in $$list; do \ if test ! -r $(srcdir)/$${cfg}; then continue; fi; \ - if test -f $(configdir)/$${cfg}; then \ - echo NOT overwriting $${cfg} in $(configdir)...; \ + if test -f $(DESTDIR)$(configdir)/$${cfg}; then \ + echo NOT overwriting $${cfg} in $(DESTDIR)$(configdir)...; \ else \ - echo installing $${cfg} in $(configdir)...; \ - $(INSTALL_DATA) $(srcdir)/$${cfg} $(configdir)/$${cfg} || exit 1; \ + echo installing $${cfg} in $(DESTDIR)$(configdir)...; \ + $(INSTALL_DATA) $(srcdir)/$${cfg} $(DESTDIR)$(configdir)/$${cfg} || exit 1; \ fi; \ done diff -ur sane-devel-20000123.orig/doc/Makefile.in sane-devel-20000123/doc/Makefile.in --- sane-devel-20000123.orig/doc/Makefile.in Sun Nov 14 02:31:57 1999 +++ sane-devel-20000123/doc/Makefile.in Wed Jan 26 13:59:24 2000 @@ -21,6 +21,8 @@ oldincludedir = /usr/include configdir = ${sysconfdir}/sane.d +DESTDIR = + MKDIR = $(top_srcdir)/mkinstalldirs INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -51,14 +53,14 @@ -e 's|@SBINDIR@|$(sbindir)|g' $^ >$@ install: $(MANPAGES) - $(MKDIR) $(mandir)/man1 $(mandir)/man5 + $(MKDIR) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 @for page in $(SECT1); do \ - echo installing $${page} in $(mandir)/man1/$${page}...; \ - $(INSTALL_DATA) $${page} $(mandir)/man1/$${page} || exit 1; \ + echo installing $${page} in $(DESTDIR)$(mandir)/man1/$${page}...; \ + $(INSTALL_DATA) $${page} $(DESTDIR)$(mandir)/man1/$${page} || exit 1; \ done @for page in $(SECT5); do \ - echo installing $${page} in $(mandir)/man5/$${page}...; \ - $(INSTALL_DATA) $${page} $(mandir)/man5/$${page} || exit 1; \ + echo installing $${page} in $(DESTDIR)$(mandir)/man5/$${page}...; \ + $(INSTALL_DATA) $${page} $(DESTDIR)$(mandir)/man5/$${page} || exit 1; \ done docs: ps html diff -ur sane-devel-20000123.orig/frontend/Makefile.in sane-devel-20000123/frontend/Makefile.in --- sane-devel-20000123.orig/frontend/Makefile.in Mon Aug 9 19:05:40 1999 +++ sane-devel-20000123/frontend/Makefile.in Wed Jan 26 13:57:32 2000 @@ -66,16 +66,16 @@ all: $(PROGRAMS) install: $(PROGRAMS) - $(MKDIR) $(bindir) $(sbindir) $(datadir) + $(MKDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir) $(DESTDIR)$(datadir) @for program in $(BINPROGS); do \ $(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) $${program} \ - $(bindir)/$${program}; \ + $(DESTDIR)$(bindir)/$${program}; \ done @for program in $(SBINPROGS); do \ $(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) $${program} \ - $(sbindir)/$${program}; \ + $(DESTDIR)$(sbindir)/$${program}; \ done - $(INSTALL_DATA) $(srcdir)/sane-style.rc $(datadir)/sane-style.rc + $(INSTALL_DATA) $(srcdir)/sane-style.rc $(DESTDIR)$(datadir)/sane-style.rc test: test.o $(LIBSANE) $(LIBLIB) @$(LIBTOOL) $(MLINK) $(LINK) test.o $(LIBSANE) $(LIBLIB) $(LIBS) diff -ur sane-devel-20000123.orig/japi/Makefile.in sane-devel-20000123/japi/Makefile.in --- sane-devel-20000123.orig/japi/Makefile.in Mon Aug 9 19:06:00 1999 +++ sane-devel-20000123/japi/Makefile.in Wed Jan 26 14:01:25 2000 @@ -25,6 +25,8 @@ oldincludedir = /usr/include configdir = ${sysconfdir}/sane.d +DESTDIR = + V_MAJOR = @V_MAJOR@ V_MINOR = @V_MINOR@ DLL_PRELOAD = @DLL_PRELOAD@ @@ -90,10 +92,10 @@ # Install library. Don't know where to install .class files yet. install: - $(MKDIR) $(libdir) $(configdir) + $(MKDIR) $(DESTDIR)$(libdir) $(DESTDIR)$(configdir) $(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) libsanej.la \ - $(libdir)/libsanej.la || exit 1; - @$(LIBTOOL) $(MINST) --finish $(libdir) + $(DESTDIR)$(libdir)/libsanej.la || exit 1; + @$(LIBTOOL) $(MINST) --finish $(DESTDIR)$(libdir) Sane.c: Sane.h --- sane-devel-20000123.orig/tools/Makefile.in Fri Jan 7 13:44:28 2000 +++ sane-devel-20000123/tools/Makefile.in Wed Jan 26 15:37:20 2000 @@ -22,6 +22,8 @@ oldincludedir = /usr/include configdir = ${sysconfdir}/sane.d +DESTDIR = + MKDIR = $(top_srcdir)/mkinstalldirs INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -64,8 +66,9 @@ all: $(DESTINATIONS) -install: sane-config - $(INSTALL_PROGRAM) sane-config $(bindir)/sane-config +install: all + $(INSTALL_PROGRAM) sane-config $(DESTDIR)$(bindir)/sane-config + $(INSTALL_PROGRAM) find-scanner $(DESTDIR)$(bindir)/find-scanner sane-config: sane-config.in $(top_builddir)/config.status cd $(top_builddir) \

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 12:22:47 PST