diff --git a/.gitignore b/.gitignore index fc743f10..cc378daa 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ depcomp install-sh missing lsusb - +lsusb.8 +update-usbids.sh diff --git a/Makefile.am b/Makefile.am index 85154448..eee0cbc3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,6 +12,9 @@ endif sbin_PROGRAMS = \ lsusb +sbin_SCRIPTS = \ + update-usbids.sh + lsusb_SOURCES = \ lsusb.c \ lsusb-t.c \ @@ -27,15 +30,28 @@ lsusb_CPPFLAGS = \ lsusb_LDADD = \ $(LIBUSB_LIBS) -dist_man_MANS = \ +man_MANS = \ lsusb.8 EXTRA_DIST = \ usb.ids \ - update-usbids.sh + update-usbids.sh.in \ + lsusb.8.in usb.ids.gz: $(srcdir)/usb.ids gzip -c -9 $< > $@ +update-usbids.sh: $(srcdir)/update-usbids.sh.in + sed 's|@usbids@|$(datadir)/usb.ids|g' $< >$@ + chmod 755 $@ + +lsusb.8: $(srcdir)/lsusb.8.in + sed 's|@usbids@|$(datadir)/usb.ids|g' $< >$@ + +DISTCLEANFILES = \ + usb.ids.gz \ + lsusb.8 \ + update-usbids.sh + distclean-local: rm -rf autom4te.cache diff --git a/configure.ac b/configure.ac index 9013f22e..48df0ba2 100644 --- a/configure.ac +++ b/configure.ac @@ -3,6 +3,8 @@ AC_INIT([usbutils], [linux-usb@vger.kernel.org]) AC_PREREQ(2.60) AM_INIT_AUTOMAKE([check-news foreign 1.9 dist-bzip2]) +AC_PREFIX_DEFAULT([/usr]) + AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE @@ -38,6 +40,7 @@ AC_MSG_RESULT([ prefix: ${prefix} datarootdir: ${datarootdir} + datadir: ${datadir} mandir: ${mandir} usb.ids: ${datadir}/usb.ids diff --git a/lsusb.8 b/lsusb.8.in similarity index 98% rename from lsusb.8 rename to lsusb.8.in index 14e662c9..1922b0ac 100644 --- a/lsusb.8 +++ b/lsusb.8.in @@ -55,7 +55,7 @@ If the specified device is not found, a non-zero exit code is returned. .SH FILES .TP -.B /usr/share/usb.ids +.B @usbids@ A list of all known USB ID's (vendors, products, classes, subclasses and protocols). .SH SEE ALSO diff --git a/update-usbids.sh b/update-usbids.sh.in similarity index 98% rename from update-usbids.sh rename to update-usbids.sh.in index 3072f036..4a487ed7 100755 --- a/update-usbids.sh +++ b/update-usbids.sh.in @@ -6,7 +6,7 @@ set -e SRC="http://www.linux-usb.org/usb.ids" -DEST=usb.ids +DEST=@usbids@ # if usb.ids is read-only (because the filesystem is read-only), # then just skip this whole process.