On Mon, 19 Nov 2001, William F. Acker WB2FLW +1-303-777-8123 wrote:

> On Mon, 19 Nov 2001, Gordon Messmer wrote:
> 
> > Not bad... I downloaded the src.rpms and fixed up the spec files a bit.  
> > I'll be mailing the fixes to the author... as soon as I figure out who 
> > that is.  I haven't looked yet.  :)
> > 
> I just used the specfiles produced by the configure scripts in the 
> tarballs, messed with the post script to run the snddevices script and 
> added a preun section for the removal of the init script.  Sorry I didn't 
> think to add a %Changelog.  Please send the corrected specfiles to me.

OK, I'm copying the devel list.  Perhaps some of this is appropriate for 
proper distribution.

I'm including a couple of patches for Makefiles which allow packaging, and 
fixes to the spec files.

alsa-driver-makefile.patch:
        Removing the '-o root -g root' arguments to install allows 
        packages to be built as non-root users, as is appropriate on 
        systems with proper package managers.

alsa-utils-buildnonroot.patch:
        Fixes builds outside of the root directory (using DESTDIR)

alsa-driver.spec:
        kversion should always be the running kernel version.
        BuildRoot should be in /var/tmp, since /tmp is frequently too 
        small to build packages inside.
        The %{configure} macro sets the distribution's preferred
        installation paths for everything.
        Use DESTDIR for 'make install'
        Include CARDS-STATUS in the package docs

alsa-lib.spec:
        Use a proper root for relocation (/usr).
        Use proper BuildRoot (as above).
        Use %{configure} macro (as above).
        Use DESTDIR (as above).

alsa-utils.spec:
        Use a proper root for relocation (as above)
        Use a proper BuildRoot (as above)
        Use %{configure} macro (what was up with this spec??)
        Use DESTDIR (as above)

-- 
If I had a dollar for every brain that you don't have,
        I'd have one dollar. - Squidward to SpongeBob

%define version  0.9.0beta9
%define kversion %(uname -r)

Summary:   ALSA driver
Name:      alsa-driver
Version:   %{version}
Release:   1
Source:    alsa-driver-%{version}.tar.bz2
Patch:     alsa-driver-makefile.patch
URL:       http://www.alsa-project.org
Copyright: GPL
Group:     Base/Kernel
Requires:  kernel = %{kversion} kernel-headers
BuildRoot: /var/tmp/alsa-driver-%{version}-root

%description
Advanced Linux Sound Architecture driver. Driver is fully compatible
with OSS/Lite, but contains many enhanced features.

%prep
%setup
%patch -p1 -b .buildnonroot

%build
%{configure} --with-kernel=/usr/src/linux-2.4 ${EXTRA_ALSA_DRIVER_CONFIG_FLAGS}
make

%install
rm -rf $RPM_BUILD_ROOT

for I in etc/rc.d/init.d usr/include lib/modules/%{kversion}/misc; do
  mkdir -p $RPM_BUILD_ROOT/$I
done

make DESTDIR=${RPM_BUILD_ROOT} install

install -m755 utils/alsasound $RPM_BUILD_ROOT/etc/rc.d/init.d/alsasound

%post
/usr/share/doc/alsa-driver-%{version}/snddevices > /dev/null
if [ -x /sbin/chkconfig ]; then
  chkconfig --add alsasound
fi
depmod -a
service alsasound start

%preun
if [ "$1" = 0 ] ; then
  if [ -x /sbin/chkconfig ]; then
    chkconfig --del alsasound
service alsasound stop
  fi
fi

%clean
rm -rf $RPM_BUILD_ROOT

%files
%attr(-,root,root) %doc FAQ INSTALL README CARDS-STATUS TODO snddevices doc/
%attr(-,root,root) %config /etc/rc.d/init.d/*
%attr(-,root,root) /usr/include/sound/*.h
%attr(-,root,root) /lib/modules/%{kversion}/misc/*.o
%define ver      0.9.0beta9
%define rel      1
%define prefix   /usr

Summary: Advanced Linux Sound Architecture (ALSA) - Library
Name: alsa-lib
Version: %ver
Release: %rel
Copyright: GPL
Group: System/Libraries
Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{ver}.tar.bz2
BuildRoot: /var/tmp/alsa-lib-%{ver}
URL: http://www.alsa-project.org
Docdir: %{prefix}/share/doc
Requires: alsa-driver

%description

Advanced Linux Sound Architecture (ALSA) - Library

%changelog

* Mon May 28 1998 Helge Jensen <[EMAIL PROTECTED]>

- Made SPEC file

%prep
%setup

%build
%{configure}
make

%install
mkdir -p $RPM_BUILD_ROOT/usr/include/alsa
mkdir -p $RPM_BUILD_ROOT/usr/lib

make DESTDIR="$RPM_BUILD_ROOT" install

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)

%doc doc/*.html
%doc doc/*.sgml
%doc doc/*.txt

%{prefix}/include/*/*.h
%{prefix}/lib/lib*
%{prefix}/share/aclocal/alsa.m4
%{prefix}/share/alsa/*
%{prefix}/bin/*
%define ver      0.9.0beta9
%define rel      1
%define prefix   /usr

Summary: Advanced Linux Sound Architecture (ALSA) - Utils
Name: alsa-utils
Version: %ver
Release: %rel
Copyright: GPL
Group: System/Libraries
Source: ftp://ftp.alsa-project.org/pub/utils/alsa-utils-%{ver}.tar.bz2
Patch: alsa-utils-buildnonroot.patch
BuildRoot: /var/tmp/alsa-utils-%{ver}
URL: http://www.alsa-project.org
Docdir: %{prefix}/share/doc
Requires: alsa-lib alsa-driver
%description

Advanced Linux Sound Architecture (ALSA) - Utils

%changelog

* Mon May 28 1998 Helge Jensen <[EMAIL PROTECTED]>

- Made SPEC file

%prep
%setup
%patch -p1 -b .buildnonroot

%build
%{configure}
make

%install
mkdir -p $RPM_BUILD_ROOT/usr/bin $RPM_BUILD_ROOT/usr/share/man/man1

make DESTDIR="$RPM_BUILD_ROOT" install

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)

%doc ChangeLog COPYING README config.status

%{prefix}/sbin/*
%{prefix}/bin/*
%{prefix}/share/man/man1/*
--- alsa-driver-0.9.0beta9/Makefile.orig        Sat Nov 17 14:34:48 2001
+++ alsa-driver-0.9.0beta9/Makefile     Sat Nov 17 14:35:44 2001
@@ -72,9 +72,9 @@
                ln -sf $(SRCDIR)/include $(DESTDIR)$(prefix)/include/sound; \
        else \
                rm -rf $(DESTDIR)$(prefix)/include/sound; \
-               install -d -m 755 -g root -o root $(DESTDIR)$(prefix)/include/sound; \
+               install -d -m 755 $(DESTDIR)$(prefix)/include/sound; \
                for f in include/*.h; do \
-                       install -m 644 -g root -o root $$f 
$(DESTDIR)$(prefix)/include/sound; \
+                       install -m 644 $$f $(DESTDIR)$(prefix)/include/sound; \
                done \
        fi
 
@@ -90,11 +90,11 @@
 
 install-scripts:
        if [ -d /sbin/init.d ]; then \
-         install -m 755 -g root -o root utils/alsasound 
$(DESTDIR)/sbin/init.d/alsasound; \
+         install -m 755 utils/alsasound $(DESTDIR)/sbin/init.d/alsasound; \
        elif [ -d /etc/rc.d/init.d ]; then \
-         install -m 755 -g root -o root utils/alsasound 
$(DESTDIR)/etc/rc.d/init.d/alsasound; \
+         install -m 755 utils/alsasound $(DESTDIR)/etc/rc.d/init.d/alsasound; \
        elif [ -d /etc/init.d ]; then \
-         install -m 755 -g root -o root utils/alsasound 
$(DESTDIR)/etc/init.d/alsasound; \
+         install -m 755 utils/alsasound $(DESTDIR)/etc/init.d/alsasound; \
        fi
 
 clean:
--- alsa-utils-0.9.0beta9/aplay/Makefile.am.orig        Sat Nov 17 16:45:24 2001
+++ alsa-utils-0.9.0beta9/aplay/Makefile.am     Sat Nov 17 16:45:57 2001
@@ -20,9 +20,9 @@
        $(LN_S) $< $@
 
 install-exec-hook:
-       rm -f $(bindir)/arecord
+       rm -f $(DESTDIR)$(bindir)/arecord
        (cd $(DESTDIR)$(bindir) && $(LN_S) aplay arecord)
 
 install-data-hook:
-       rm -f $(mandir)/man1/arecord.1
+       rm -f $(DESTDIR)$(mandir)/man1/arecord.1
        (cd $(DESTDIR)$(mandir)/man1 && $(LN_S) aplay.1 arecord.1)

Reply via email to