]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - Makefile.am
Imported Upstream version 6.3+svn3990
[mirror_smartmontools-debian.git] / Makefile.am
index 25f625e58e9e7f33240f88d10cd16677b8305ac5..440153711469fea1531749cd2fa44056231ffdf5 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 #
-# $Id: Makefile.am 3759 2013-01-26 21:11:02Z chrfranke $
+# $Id: Makefile.am 3957 2014-07-18 18:39:06Z chrfranke $
 #
 
 @SET_MAKE@
@@ -13,7 +13,11 @@ SUFFIXES = .cpp .c .s .o
 # BUILD_INFO can be provided by package maintainers (see INSTALL file)
 BUILD_INFO= "(local build)"
 
-AM_CPPFLAGS = -DBUILD_INFO='$(BUILD_INFO)' -DSMARTMONTOOLS_SYSCONFDIR='"$(sysconfdir)"'
+AM_CPPFLAGS = \
+        -DBUILD_INFO='$(BUILD_INFO)' \
+        -DSMARTMONTOOLS_SYSCONFDIR='"$(sysconfdir)"' \
+        -DSMARTMONTOOLS_SMARTDSCRIPTDIR='"$(smartdscriptdir)"'
+
 if ENABLE_DRIVEDB
 AM_CPPFLAGS += -DSMARTMONTOOLS_DRIVEDBDIR='"$(drivedbdir)"'
 endif
@@ -96,6 +100,7 @@ EXTRA_smartctl_SOURCES = \
         os_win32.cpp \
         os_generic.cpp \
         os_generic.h \
+        aacraid.h \
         cciss.cpp \
         cciss.h \
         cissio_freebsd.h \
@@ -155,6 +160,7 @@ EXTRA_smartd_SOURCES = \
         os_win32.cpp \
         os_generic.cpp \
         os_generic.h \
+        aacraid.h \
         cciss.cpp \
         cciss.h \
         cissio_freebsd.h \
@@ -242,6 +248,11 @@ if OS_SOLARIS
 extra_MANS =      smartd.conf.4 \
                   smartctl.1m   \
                   smartd.1m
+if ENABLE_DRIVEDB
+extra_MANS += update-smart-drivedb.1m
+endif
+
+all-local: $(extra_MANS)
 install-man: $(extra_MANS)
        @$(NORMAL_INSTALL)
        $(mkinstalldirs) $(DESTDIR)$(mandir)/man4
@@ -268,27 +279,17 @@ uninstall-man:
          echo " rm -f $(DESTDIR)$(mandir)/man$$ext/$$inst"; \
          rm -f $(DESTDIR)$(mandir)/man$$ext/$$inst; \
        done
-%.1m: %.8
-       awk '/^.TH/ {$$3="1m"} {print}' < $< | \
-       sed -e 's/smartd\.conf\(.*\)(5)/smartd.conf\1(4)/g' \
-            -e 's/syslog\.conf\(.*\)(5)/syslog.conf\1(4)/g' \
-           -e 's/smartctl\(.*\)(8)/smartctl\1(1m)/g' \
-           -e 's/syslogd\(.*\)(8)/syslogd\1(1m)/g' \
-            -e 's|/var/log/messages|/var/adm/messages|g' \
-           -e 's/smartd\(.*\)(8)/smartd\1(1m)/g' > $@
-%.4: %.5
-       awk '/^.TH/ {$$3="4"}  {print}' < $< | \
-       sed -e 's/smartd\.conf\(.*\)(5)/smartd.conf\1(4)/g' \
-            -e 's/syslog\.conf\(.*\)(5)/syslog.conf\1(4)/g' \
-           -e 's/smartctl\(.*\)(8)/smartdctl\1(1m)/g' \
-           -e 's/syslogd\(.*\)(8)/syslogd\1(1m)/g' \
-            -e 's|/var/log/messages|/var/adm/messages|g' \
-           -e 's/smartd\(.*\)(8)/smartd\1(1m)/g' > $@
 else
 # For systems that adopts traditional manner
+
 man_MANS =        smartd.conf.5 \
                   smartctl.8    \
                   smartd.8
+
+if ENABLE_DRIVEDB
+man_MANS += update-smart-drivedb.8
+endif
+
 endif
 
 docsdir=$(docdir)
@@ -311,7 +312,9 @@ examples_SCRIPTS = \
         examplescripts/Example1 \
         examplescripts/Example2 \
         examplescripts/Example3 \
-        examplescripts/Example4
+        examplescripts/Example4 \
+        examplescripts/Example5 \
+        examplescripts/Example6
 
 sysconf_DATA = smartd.conf
 
@@ -345,9 +348,7 @@ uninstall-sysconfDATA:
        echo " rm -f $$f"; \
        rm -f "$$f"
 
-# automake does not allow 'sysconf_SCRIPTS'
-sysscriptdir = $(sysconfdir)
-sysscript_SCRIPTS = smartd_warning.sh
+smartdscript_SCRIPTS = smartd_warning.sh
 
 EXTRA_DIST = \
         autogen.sh \
@@ -360,6 +361,7 @@ EXTRA_DIST = \
         smartd.service.in \
         smartd_warning.sh.in \
         update-smart-drivedb.in \
+        update-smart-drivedb.8.in \
         m4/pkg.m4 \
         os_darwin/SMART.in \
         os_darwin/StartupParameters.plist \
@@ -398,12 +400,15 @@ CLEANFILES = \
         smartd_warning.sh \
         svnversion.h \
         update-smart-drivedb \
+        update-smart-drivedb.8 \
+        update-smart-drivedb.1m \
         SMART
 
 # 'make maintainer-clean' also removes files generated by './autogen.sh'
 MAINTAINERCLEANFILES = \
         $(srcdir)/Makefile.in \
         $(srcdir)/aclocal.m4 \
+        $(srcdir)/compile \
         $(srcdir)/configure \
         $(srcdir)/config.guess \
         $(srcdir)/config.h.in \
@@ -420,8 +425,9 @@ utility.o: svnversion.h
 if IS_SVN_BUILD
 # Get version info from SVN
 svnversion.h: ChangeLog Makefile $(svn_deps)
-       echo '/* svnversion.h.  Generated by Makefile from svn info.  */' > $@
-       (cd $(srcdir) \
+       @echo '  svn info | $$(VERSION_FROM_SVN_INFO) > $@'
+       @echo '/* svnversion.h.  Generated by Makefile from svn info.  */' > $@
+       @(cd $(srcdir) \
         && svnversion 2>/dev/null | sed -n 's,^\([0-9].*\),REV  "\1",p' \
         && TZ= LC_ALL=C svn info 2>/dev/null \
         | sed -n 'h;s,^.* Date: *\([^ ]*\) .*$$,DATE "\1",p;g;s,^.* Date: *[^ ]* *\([^ ]*\) .*$$,TIME "\1",p') \
@@ -430,8 +436,9 @@ else
 
 # SVN not available, guess version info from Id strings
 svnversion.h: ChangeLog Makefile
-       echo '/* svnversion.h.  Generated by Makefile from Id strings.  */' > $@
-       (cd $(srcdir) && cat ChangeLog Makefile.am configure.ac smart*.in *.cpp *.h *.s) \
+       @echo '  cat ChangeLog $$(SOURCES) | $$(VERSION_FROM_SVN_IDS) > $@'
+       @echo '/* svnversion.h.  Generated by Makefile from Id strings.  */' > $@
+       @(cd $(srcdir) && cat ChangeLog Makefile.am configure.ac smart*.in *.cpp *.h *.s) \
        | sed -n 's,^.*\$$[I][d]: [^ ]* \([0-9][0-9]* [0-9][-0-9]* [0-9][:0-9]*\)[^:0-9][^$$]*\$$.*$$,\1,p' \
        | sort -n -r \
        | sed -n 'h;s,^\([^ ]*\) .*$$,REV  "\1",p;g;s,^[^ ]* \([^ ]*\) .*$$,DATE "\1",p;g;s,^[^ ]* [^ ]* \([^ ]*\)$$,TIME "\1",p;q' \
@@ -443,16 +450,6 @@ if ENABLE_DRIVEDB
 drivedb_DATA = drivedb.h
 endif
 
-if ENABLE_SAVESTATES
-# Create $(savestatesdir) only
-savestates_DATA =
-endif
-
-if ENABLE_ATTRIBUTELOG
-# Create $(attributelogdir) only
-attributelog_DATA =
-endif
-
 update-smart-drivedb: update-smart-drivedb.in config.status
        $(SHELL) ./config.status --file=$@
        chmod +x $@
@@ -530,10 +527,30 @@ systemdsystemunit_DATA = smartd.service
 endif
 
 smartd.service: smartd.service.in Makefile
-       sed -e 's|/usr/local/sbin/smartd|$(sbindir)/smartd|g' \
-           -e 's|/usr/local/etc/sysconfig/smartmontools|$(sysconfdir)/sysconfig/smartmontools|g' \
-       $(srcdir)/smartd.service.in > $@
+       cat $(srcdir)/smartd.service.in | \
+       sed 's|/usr/local/sbin/smartd|$(sbindir)/smartd|' | \
+       if test -n '$(systemdenvfile)'; then \
+         sed 's|/usr/local/etc/sysconfig/smartmontools|$(systemdenvfile)|'; \
+       else \
+         sed -e '/^EnvironmentFile=/d' -e 's| *\$$smartd[_a-z]* *||g'; \
+       fi > $@
+
+
+# Create empty directories if configured.
+# Default install rules no longer create empty directories since automake 1.11.
+# Uses $(mkinstalldirs) instead of $(MKDIR_P) to preserve support for automake 1.7 - 1.9.
+installdirs-local:
+       @for d in '$(smartdplugindir)' '$(savestatesdir)' '$(attributelogdir)'; do \
+         test -n "$$d" || continue; \
+         echo "$(mkinstalldirs) $(DESTDIR)$$d"; \
+         $(mkinstalldirs) "$(DESTDIR)$$d" || exit 1; \
+       done
+
+install-data-local: installdirs-local
 
+#
+# Build man pages
+#
 if ENABLE_CAPABILITIES
 MAN_CAPABILITIES = cat
 else
@@ -569,8 +586,17 @@ MAN_FILTER = \
         -e 's|/usr/local/share/doc/smartmontools/|$(docsdir)/|g' \
         -e 's|!exampledir!|$(exampledir)/|g' \
         -e 's|/usr/local/etc/smartd\.conf|$(sysconfdir)/smartd.conf|g' \
-        -e 's|/usr/local/etc/smartd_warning\.|$(sysconfdir)/smartd_warning.|g' \
-        -e 's|/usr/local/etc/smart_drivedb\.h|$(sysconfdir)/smart_drivedb.h|g' | \
+        -e 's|/usr/local/etc/smart_drivedb\.h|$(sysconfdir)/smart_drivedb.h|g' \
+        -e 's|/usr/local/etc/smartd_warning\.sh|$(smartdscriptdir)/smartd_warning.sh|g' \
+        -e 's|\\fBmail\\fP|\\fB$(os_mailer)\\fP|g' \
+        -e 's|\\'\''mail\\'\''|\\'\''$(os_mailer)\\'\''|g' \
+        -e 's|/usr/bin/mail|/usr/bin/$(os_mailer)|g' \
+        -e 's|RELEASE_6_0_DRIVEDB|@DRIVEDB_BRANCH@|g' | \
+    if test -n '$(smartdplugindir)'; then \
+      sed 's|/usr/local/etc/smartd_warning\.d|$(smartdplugindir)|g' ; \
+    else \
+      sed '/^\.\\" %IF ENABLE_SMARTDPLUGINDIR/,/^\.\\" %ENDIF ENABLE_SMARTDPLUGINDIR/ s,^,.\\"\# ,' ; \
+    fi | \
     $(MAN_ATTRIBUTELOG) | \
     $(MAN_CAPABILITIES) | \
     $(MAN_DRIVEDB) | \
@@ -589,13 +615,45 @@ MAN_FILTER = \
 
 # Implicit rule 'smart%: smart%.in ...' does not work with BSD make
 smartctl.8: smartctl.8.in Makefile svnversion.h
-       cat $(srcdir)/smartctl.8.in | $(MAN_FILTER) > $@
+       @echo '  cat $(srcdir)/smartctl.8.in | $$(MAN_FILTER) > $@'
+       @cat $(srcdir)/smartctl.8.in | $(MAN_FILTER) > $@
 
 smartd.8: smartd.8.in Makefile svnversion.h
-       cat $(srcdir)/smartd.8.in | $(MAN_FILTER) > $@
+       @echo '  cat $(srcdir)/smartd.8.in | $$(MAN_FILTER) > $@'
+       @cat $(srcdir)/smartd.8.in | $(MAN_FILTER) > $@
 
 smartd.conf.5: smartd.conf.5.in Makefile svnversion.h
-       cat $(srcdir)/smartd.conf.5.in | $(MAN_FILTER) > $@
+       @echo '  cat $(srcdir)/smartd.conf.5.in | $$(MAN_FILTER) > $@'
+       @cat $(srcdir)/smartd.conf.5.in | $(MAN_FILTER) > $@
+
+update-smart-drivedb.8: update-smart-drivedb.8.in Makefile svnversion.h
+       @echo '  cat $(srcdir)/update-smart-drivedb.8.in | $$(MAN_FILTER) > $@'
+       @cat $(srcdir)/update-smart-drivedb.8.in | $(MAN_FILTER) > $@
+
+# Build Solaris specific man pages
+SOLARIS_MAN_FILTER = \
+    sed -e '/^\.TH/s, \([58]\) , !!\1!! ,' \
+        -e '/^\.BR/s, (\([578]\)), (!!\1!!),' \
+        -e 's,\\fP(\([578]\)),\\fP(!!\1!!),g' \
+        -e 's,!!5!!,4,g' -e 's,!!7!!,5,g' -e 's,!!8!!,1m,g' \
+        -e 's,/var/log/messages,/var/adm/messages,g'
+
+smartctl.1m: smartctl.8
+       @echo '  cat smartctl.8 | $$(SOLARIS_MAN_FILTER) > $@'
+       @cat smartctl.8 | $(SOLARIS_MAN_FILTER) > $@
+
+smartd.1m: smartd.8
+       @echo '  cat smartd.8 | $$(SOLARIS_MAN_FILTER) > $@'
+       @cat smartd.8 | $(SOLARIS_MAN_FILTER) > $@
+
+smartd.conf.4: smartd.conf.5
+       @echo '  cat smartd.conf.5 | $$(SOLARIS_MAN_FILTER) > $@'
+       @cat smartd.conf.5 | $(SOLARIS_MAN_FILTER) > $@
+
+update-smart-drivedb.1m: update-smart-drivedb.8
+       @echo '  cat update-smart-drivedb.8 | $$(SOLARIS_MAN_FILTER) > $@'
+       @cat update-smart-drivedb.8 | $(SOLARIS_MAN_FILTER) > $@
+
 
 # Commands to convert man pages into .html and .txt
 # TODO: configure
@@ -657,12 +715,13 @@ smartctl_res.o: smartctl_res.rc
 smartd_res.o: smartd_res.rc syslogevt.rc
        $(WINDRES) -I. $< $@
 
-# Convert version for VERSIONINFO resource: 6.1 r3754 -> 6.1.0.3754
+# Convert version for VERSIONINFO resource: 6.1 r3754 -> 6.1.0.3754, set Copyright year
 WIN_RC_FILTER = \
     ( ver=`echo '$(PACKAGE_VERSION).0' | sed -n 's,^\([0-9]*\.[0-9]*\.[0-9]*\).*$$,\1,p'`; \
       rev=`sed -n 's,^.*REV[^"]*"\([0-9]*\).*$$,\1,p' svnversion.h`; \
       txtver="$${ver:-0.0.0}.$${rev:-0}"; binver=`echo "$$txtver" | sed 's|\.|,|g'`; \
-      sed -e "s|@BINARY_VERSION@|$$binver|g" -e "s|@TEXT_VERSION@|$$txtver|g"; )
+      yy=`sed -n 's,^.*DATE[^"]*"20\([0-9][0-9]\).*$$,\1,p' svnversion.h`; yy="$${yy:-XX}"; \
+      sed -e "s|@BINARY_VERSION@|$$binver|g" -e "s|@TEXT_VERSION@|$$txtver|g" -e "s|@YY@|$$yy|g"; )
 
 smartctl_res.rc: os_win32/smartctl_res.rc.in Makefile svnversion.h
        cat $< | $(WIN_RC_FILTER) > $@