xref: /freebsd/contrib/libxo/Makefile.am (revision 0e97acdf58fe27b09c4824a474b0344daf997c5f)
1#
2# $Id$
3#
4# Copyright 2014, Juniper Networks, Inc.
5# All rights reserved.
6# This SOFTWARE is licensed under the LICENSE provided in the
7# ../Copyright file. By downloading, installing, copying, or otherwise
8# using the SOFTWARE, you agree to be bound by the terms of that
9# LICENSE.
10
11ACLOCAL_AMFLAGS = -I m4
12
13SUBDIRS = libxo xo xolint tests doc
14bin_SCRIPTS=libxo-config
15dist_doc_DATA = Copyright
16
17EXTRA_DIST = \
18    libxo-config.in \
19    warnings.mk \
20    README.md \
21    INSTALL.md \
22    packaging/libxo.spec
23
24.PHONY: test tests
25
26test tests:
27	@(cd tests ; ${MAKE} test)
28
29errors:
30	@(cd tests/errors ; ${MAKE} test)
31
32docs:
33	@(cd doc ; ${MAKE} docs)
34
35
36DIST_FILES_DIR = ~/Dropbox/dist-files/
37GH_PAGES_DIR = gh-pages/
38PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz
39
40upload: dist upload-docs
41	@echo "Remember to run:"
42	@echo "        gt tag ${PACKAGE_VERSION}"
43
44upload-docs: docs
45	@echo "Uploading libxo-manual.html ... "
46	@-[ -d ${GH_PAGES_DIR} ] \
47		&& echo "Updating manual on gh-pages ..." \
48		&& cp doc/libxo-manual.html ${GH_PAGES_DIR} \
49		&& (cd ${GH_PAGES_DIR} \
50			&& git commit -m 'new docs' \
51                               libxo-manual.html \
52			&& git push origin gh-pages ) ; true
53
54pkgconfigdir=$(libdir)/pkgconfig
55pkgconfig_DATA = packaging/${PACKAGE_NAME}.pc
56
57get-wiki:
58	git clone https://github.com/Juniper/${PACKAGE_NAME}.wiki.git wiki
59
60get-gh-pages:
61	git clone https://github.com/Juniper/${PACKAGE_NAME}.git \
62		gh-pages -b gh-pages
63
64UPDATE_PACKAGE_FILE = \
65    -e "s;__SHA1__;$$SHA1;" \
66    -e "s;__SHA256__;SHA256 (textproc/${PACKAGE_FILE}) = $$SHA256;" \
67    -e "s;__SIZE__;SIZE (textproc/${PACKAGE_FILE}) = $$SIZE;"
68
69GH_PACKAGING_DIR = packaging/${PACKAGE_VERSION}
70GH_PAGES_PACKAGE_DIR = ${GH_PAGES_DIR}/${GH_PACKAGING_DIR}
71
72packages:
73	@-[ -d ${GH_PAGES_DIR} ] && set -x \
74		&& echo "Updating packages on gh-pages ..." \
75		&& SHA1="`openssl sha1 ${PACKAGE_FILE} | awk '{print $$2}'`" \
76		&& SHA256="`openssl sha256 ${PACKAGE_FILE} | awk '{print $$2}'`" \
77		&& SIZE="`ls -l ${PACKAGE_FILE} | awk '{print $$5}'`" \
78		&& mkdir -p ${GH_PAGES_PACKAGE_DIR}/freebsd \
79		&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb ..." \
80		&& sed ${UPDATE_PACKAGE_FILE} \
81			packaging/${PACKAGE_NAME}.rb.base \
82			> ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb \
83		&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec ..." \
84		&& cp packaging/${PACKAGE_NAME}.spec \
85			${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec \
86		&& echo "... ${GH_PAGES_PACKAGE_DIR}/freebsd ..." \
87		&& sed ${UPDATE_PACKAGE_FILE} \
88			${srcdir}/packaging/freebsd/distinfo.base \
89			> ${GH_PAGES_PACKAGE_DIR}/freebsd/distinfo \
90		&& cp ${srcdir}/packaging/freebsd/pkg-descr \
91			${GH_PAGES_PACKAGE_DIR}/freebsd/pkg-descr \
92		&& cp ${srcdir}/packaging/freebsd/pkg-plist \
93			${GH_PAGES_PACKAGE_DIR}/freebsd/pkg-plist \
94		&& cp ${srcdir}/packaging/freebsd/pkg-plist \
95			${GH_PAGES_PACKAGE_DIR}/freebsd/pkg-plist \
96		&& cp packaging/freebsd/port-Makefile \
97			${GH_PAGES_PACKAGE_DIR}/freebsd/Makefile \
98		&& (cd ${GH_PAGES_DIR} \
99			&& git add ${GH_PACKAGING_DIR} \
100			&& git commit -m 'new packaging data' \
101                               ${GH_PACKAGING_DIR} \
102			&& git push origin gh-pages ) ; true
103