"Fossies" - the Fresh Open Source Software Archive

Member "safekeep-1.5.1/Makefile" (16 Nov 2020, 6849 Bytes) of package /linux/misc/safekeep-1.5.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Makefile": 1.5.0_vs_1.5.1.

    1 name        := safekeep
    2 version_num := $(shell grep 'VERSION *=' safekeep | sed s'/[^"]*"\([^"].*\)".*/\1/')
    3 version     := $(version_num)
    4 git_version := $(shell git describe --tags)
    5 release     := 1
    6 releasename := $(name)-$(version)
    7 dirname     := $(shell basename $(PWD))
    8 rpmroot     := $(shell grep '^%_topdir' ~/.rpmmacros 2>/dev/null | sed -e 's/^[^ \t]*[ \t]*//' -e 's/%/$$/g')
    9 deb_box	    := 192.168.3.202
   10 rpm_box     := 192.168.3.242
   11 SF_USER     := $(shell whoami)
   12 sf_login    := $(SF_USER)@frs.sourceforge.net
   13 sf_dir	    := /home/frs/project/s/sa/$(name)/$(name)
   14 gitroot     := https://github.com/dimipaun
   15 releasedir  := releases
   16 repo_srv    := root@ulysses
   17 repo_dir    := /var/www/repos/lattica
   18 webroot     := ../../website/trunk/WebContent/
   19 MAN_TXT     := doc/safekeep.txt doc/safekeep.conf.txt doc/safekeep.backup.txt
   20 DOC_MAN     := doc/safekeep.1 doc/safekeep.conf.5 doc/safekeep.backup.5
   21 DOC_HTML    := $(patsubst %.txt,%.html,$(MAN_TXT))
   22 
   23 
   24 all: help
   25 
   26 help:
   27 	@echo "Targets:"
   28 	@echo "    help        Displays this message"
   29 	@echo "    info        Displays package information (version, etc.)"
   30 	@echo "    install     Installs safekeep and the online documentation"
   31 	@echo "    docs        Builds all documentation formats"
   32 	@echo "    web         Updates the website to the latest documentation"
   33 	@echo "    build       Builds everything needed for an installation"
   34 	@echo "    tag         Tags the source for release"
   35 	@echo "    dist        Builds release source distribution"
   36 	@echo "    distdeb     Builds release binary and source DEBs"
   37 	@echo "    distrpm     Buidls release binary and source RPMs"
   38 	@echo "    deploy      Deployes the release RPMs to Lattica's repos"
   39 	@echo "    check       Invokes a quick local test for SafeKeep"
   40 	@echo "    test        Invokes a comprehensive remote test for SafeKeep"
   41 	@echo "    clean       Cleans up the source tree"
   42 
   43 info:
   44 	@echo "Release Name   = $(releasename)"
   45 	@echo "Version        = $(version)"
   46 	@echo "RPM Root       = $(rpmroot)"
   47 
   48 
   49 build: docs
   50 
   51 release: check-info commit-release dist distrpm
   52 
   53 deploy: deploy-lattica deploy-sf
   54 
   55 commit-release:
   56 	git commit -a -m "Release $(version)"
   57 
   58 tag:
   59 	git tag $(version)
   60 	git push --tags
   61 
   62 check-info: info
   63 	@echo -n 'Is this information correct? (yes/No) '
   64 	@read x; if [ "$$x" != "yes" ]; then exit 1; fi
   65 
   66 web: html
   67 	cp doc/*.html $(webroot)
   68 	cd  $(webroot); svn ci -m "Update man pages on website to latest"
   69 
   70 docs: html man
   71 
   72 html: $(DOC_HTML)
   73 
   74 man: $(DOC_MAN)
   75 
   76 %.html: %.txt
   77 	asciidoc --unsafe -b html4 -d manpage -f doc/asciidoc.conf $<
   78 
   79 %.1 %.5: %.xml
   80 	xmlto -o doc -m doc/callouts.xsl man $<
   81 
   82 %.xml: %.txt
   83 	asciidoc --unsafe -b docbook -d manpage -f doc/asciidoc.conf $<
   84 
   85 $(DOC_HTML) $(DOC_MAN): doc/asciidoc.conf
   86 
   87 install:
   88 	install -d -m 755 "$(DESTDIR)/usr/bin/"
   89 	install -m 755 $(name) "$(DESTDIR)/usr/bin/"
   90 	install -d -m 755 "$(DESTDIR)/etc/$(name)/backup.d"
   91 	install -m 664 $(name).conf "$(DESTDIR)/etc/$(name)/"
   92 	install -d -m 755 "$(DESTDIR)/etc/cron.daily"
   93 	install -m 755 $(name).cron "$(DESTDIR)/etc/cron.daily/$(name)"
   94 	install -d -m 755 "$(DESTDIR)/usr/share/man/man1/"
   95 	install -m 444 doc/$(name).1 "$(DESTDIR)/usr/share/man/man1/"
   96 	install -d -m 755 "$(DESTDIR)/usr/share/man/man5/"
   97 	install -m 444 doc/$(name).conf.5 "$(DESTDIR)/usr/share/man/man5/"
   98 	install -m 444 doc/$(name).backup.5 "$(DESTDIR)/usr/share/man/man5/"
   99 
  100 tar: $(releasedir)/$(releasename).tar.gz
  101 
  102 dist: $(releasedir)/$(releasename).tar.gz
  103 
  104 $(releasedir)/$(releasename).tar.gz:
  105 	wget -q $(gitroot)/$(name)/archive/$(version).tar.gz
  106 	tar xz -f $(version).tar.gz
  107 	rm $(version).tar.gz
  108 	cat $(releasename)/$(name).spec.in | sed 's/^%define version.*/%define version $(version)/' > $(releasename)/$(name).spec
  109 	cat $(releasename)/debian/changelog.in | sed 's/^safekeep.*/safekeep ($(version)) unstable; urgency=low/' > $(releasename)/debian/changelog
  110 	cd $(releasename); make docs
  111 	mkdir -p $(releasedir); tar cz -f $(releasedir)/$(releasename).tar.gz $(releasename)
  112 	rm -rf $(releasename)
  113 
  114 distdeb: distdeb-build distdeb-sign
  115 
  116 distdeb-build: $(releasedir)/$(releasename).tar.gz
  117 	tar xz -C /tmp -f $<
  118 	cd /tmp/$(releasename) && dpkg-buildpackage -us -uc
  119 	mv /tmp/$(name)*_$(version)* $(releasedir)
  120 
  121 distdeb-sign:
  122 	debsign -k $(name) --re-sign $(releasedir)/$(name)_$(version).dsc $(releasedir)/$(name)_$(version)_amd64.*
  123 	for deb in $(releasedir)/$(name)-*_$(version)_all.deb ; do debsigs --sign=origin -k $(name) $$deb; done
  124 
  125 debsrc: $(releasedir)/$(releasename).tar.gz
  126 	cat debian/changelog.in | sed 's/^safekeep.*/safekeep ($(git_version)) unstable; urgency=low/' > debian/changelog
  127 	dpkg-buildpackage -us -uc -S
  128 
  129 distrpm: distrpm-build distrpm-sign
  130 
  131 distrpm-build: $(releasedir)/$(releasename).tar.gz
  132 	rpmbuild -ta $<
  133 	mv $(rpmroot)/SRPMS/$(releasename)-$(release)*.src.rpm $(releasedir)
  134 	mv $(rpmroot)/RPMS/noarch/$(name)-*-$(version)-$(release)*.noarch.rpm $(releasedir)
  135 
  136 distrpm-sign:
  137 	rpm --addsign $(releasedir)/$(releasename)-$(release)*.src.rpm $(releasedir)/$(name)-*-$(version)-$(release)*.noarch.rpm
  138 
  139 dist-sign: distrpm-sign distdeb-sign
  140 
  141 dist-all: dist distdeb-remote fetch-debs distrpm-remote fetch-rpms dist-sign
  142 
  143 distdeb-remote:
  144 	ssh $(deb_box) 'cd ~/git/safekeep; git pull; make distdeb-build'
  145 
  146 fetch-debs:
  147 	scp $(deb_box):~/git/safekeep/$(releasedir)/$(name)-*_$(version)_all.deb $(releasedir)
  148 
  149 distrpm-remote:
  150 	ssh $(rpm_box) 'cd ~/git/safekeep; git pull; make distrpm-build'
  151 
  152 fetch-rpms:
  153 	scp $(rpm_box):~/git/safekeep/$(releasedir)/$(name)-*$(version)-$(release).*.rpm $(releasedir)
  154 
  155 deploy-lattica:
  156 	scp $(releasedir)/${name}{,-common,-client,-server}-${version}-*.rpm ${repo_srv}:${repo_dir}/upload
  157 	ssh ${repo_srv} "cd ${repo_dir}; ./deploy-rpms.sh upload/${name}-*${version}-*.rpm"
  158 
  159 deploy-sf: $(releasedir)/CHECKSUM-$(releasename).txt
  160 	echo -e "cd $(sf_dir)\nmkdir $(version)" | sftp -b- $(sf_login)
  161 	scp $(releasedir)/$(releasename).tar.gz $(sf_login):$(sf_dir)/$(version)
  162 	scp ANNOUNCE $(sf_login):$(sf_dir)/$(version)/README.txt
  163 	scp $(releasedir)/$(releasename)-$(release)*.src.rpm $(releasedir)/$(name)-*-$(version)-$(release)*.noarch.rpm $(sf_login):$(sf_dir)/$(version)
  164 	scp $(releasedir)/$(name)-*_$(version)_all.deb $(sf_login):$(sf_dir)/$(version)
  165 	scp $(releasedir)/$(name)_$(version)* $(sf_login):$(sf_dir)/$(version)
  166 	scp $(releasedir)/CHECKSUM-$(releasename).txt $(sf_login):$(sf_dir)/$(version)
  167 	scp RPM-GPG-KEY-SafeKeep $(sf_login):$(sf_dir)/$(version)
  168 	scp README_SF_Top $(sf_login):$(sf_dir)/../README.txt
  169 
  170 $(releasedir)/CHECKSUM-$(releasename).txt:
  171 	cd $(releasedir); sha512sum $(name)*$(version)* | gpg --clearsign -u $(name) > CHECKSUM-$(releasename).txt
  172 
  173 check:
  174 	safekeep-test --local
  175 
  176 test:
  177 	safekeep-test --remote
  178 
  179 clean:
  180 	rm -f {.,doc,debian}/*~ *.py[co] 
  181 	rm -f $(name).spec debian/changelog
  182 	rm -f doc/*.xml doc/*.html doc/*.[15]
  183 	rm -f safekeep-*[.]20[01][0-9][01][0-9][0-3][0-9][012][0-9][0-5][0-9]*
  184