Test `make install`
authorPeter Colberg <peter@colberg.org>
Fri, 30 Oct 2015 22:46:28 +0000 (18:46 -0400)
committerPeter Colberg <peter@colberg.org>
Fri, 30 Oct 2015 22:46:28 +0000 (18:46 -0400)
Generate reproducible manifest of installed files.

.gitignore
.travis.yml
MANIFEST [new file with mode: 0644]
Makefile

index a592011fc2ebe958558247448b7c51201f151a93..532fa9a7a6a3b9e1a14ce9f0e1dd5ea85fb99188 100644 (file)
@@ -9,6 +9,7 @@
 *.dylib
 *.dSYM
 *.out
+*.new
 data/*.txt
 data/*.ttf
 data/*.sfd
@@ -18,9 +19,9 @@ bench/icu
 bench/unistring
 normtest
 graphemetest
-utf8proc_data.c.new
 printproperty
 charwidth
 valid
 iterate
 case
+/tmp/
index 4e399e5ad2874a5570ad023813ac3eac3ec79fa2..684df0fd69706b1b1f9a0298b4e7e55519b07d4a 100644 (file)
@@ -10,7 +10,7 @@ before_install:
     - sudo apt-get update -qq -y
     - sudo apt-get install libpcre3-dev julia fontforge -y
 script:
-    - make prefix=`pwd`/local install
+    - make manifest && diff MANIFEST.new MANIFEST
     - make check
     - make data && diff data/utf8proc_data.c.new utf8proc_data.c
     - make clean && git status --ignored --porcelain && test -z "$(git status --ignored --porcelain)"
diff --git a/MANIFEST b/MANIFEST
new file mode 100644 (file)
index 0000000..237218e
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,7 @@
+include/
+include/utf8proc.h
+lib/
+lib/libutf8proc.a
+lib/libutf8proc.so -> libutf8proc.so.1.3.0
+lib/libutf8proc.so.1 -> libutf8proc.so.1.3.0
+lib/libutf8proc.so.1.3.0
index 710dad1b0e6a8371621d00e72a45351fc82b8005..ffb1cba587594784b78b7a9fb6ec6532a6584bdd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@ MAKE=make
 AR?=ar
 CC?=gcc
 INSTALL=install
+FIND=find
 
 # compiler settings
 CFLAGS ?= -O2
@@ -17,7 +18,7 @@ UCFLAGS = $(CFLAGS) $(PICFLAG) $(C99FLAG) $(WCFLAGS) -DUTF8PROC_EXPORTS
 # from the utf8proc version number because it indicates ABI compatibility,
 # not API compatibility: MAJOR should be incremented whenever *binary*
 # compatibility is broken, even if the API is backward-compatible
-# Be sure to also update these in CMakeLists.txt!
+# Be sure to also update these in MANIFEST and CMakeLists.txt!
 MAJOR=1
 MINOR=3
 PATCH=0
@@ -38,7 +39,7 @@ includedir=$(prefix)/include
 
 # meta targets
 
-.PHONY: all, clean, update, data
+.PHONY: all clean data update manifest install
 
 all: libutf8proc.a libutf8proc.$(SHLIB_EXT)
 
@@ -48,6 +49,7 @@ ifneq ($(OS),Darwin)
        rm -f libutf8proc.so.$(MAJOR)
 endif
        rm -f test/tests.o test/normtest test/graphemetest test/printproperty test/charwidth test/valid test/iterate test/case
+       rm -rf MANIFEST.new tmp
        $(MAKE) -C bench clean
        $(MAKE) -C data clean
 
@@ -56,6 +58,8 @@ data: data/utf8proc_data.c.new
 update: data/utf8proc_data.c.new
        cp -f data/utf8proc_data.c.new utf8proc_data.c
 
+manifest: MANIFEST.new
+
 # real targets
 
 data/utf8proc_data.c.new: libutf8proc.$(SHLIB_EXT) data/data_generator.rb data/charwidths.jl
@@ -93,6 +97,12 @@ ifneq ($(OS),Darwin)
        ln -f -s libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.so.$(MAJOR)
 endif
 
+MANIFEST.new:
+       rm -rf tmp
+       $(MAKE) install prefix=/usr DESTDIR=$(PWD)/tmp
+       $(FIND) tmp/usr -mindepth 1 -type l -printf "%P -> %l\n" -or -type f -printf "%P\n" -or -type d -printf "%P/\n" | LC_ALL=C sort > $@
+       rm -rf tmp
+
 # Test programs
 
 data/NormalizationTest.txt: