#!/bin/bash DESTDIR=./dist VERSION=`git describe --tag | sed 's/^v//'` ITERATION=1 BINARY=munchclient DEFAULTS_FILE="$BINARY" SERVICE_FILE="$BINARY.service" PKG_TYPE=rpm DESCR="ScraperWall traffic collector" RPM_DIR=/opt/rpm.scraperwall.com/centos6 rm -rf $DESTDIR install -v -d $DESTDIR/{usr/bin,etc/init.d,etc/default} make install -v -m 755 $BINARY $DESTDIR/usr/bin/ install -v -m 644 defaults/$DEFAULTS_FILE $DESTDIR/etc/default/ #install -v -m 755 init.d/$BINARY $DESTDIR/etc/init.d/ #install -m 644 $SERVICE_FILE $DESTDIR/etc/systemd/system/ #install -m 644 $MAXMIND_CITY_DB $DESTDIR/usr/share/munch/ #install -m 644 $MAXMIND_ASN_DB $DESTDIR/usr/share/munch/ fpm -s dir -t $PKG_TYPE -C $DESTDIR --name $BINARY \ --version $VERSION \ --iteration $ITERATION \ --description "$DESCR" \ --config-files etc/default/$BINARY \ --rpm-init init.d/$BINARY \ --rpm-sign # --deb-systemd $SERVICE_FILE \ ok=$? rm -rf $DESTDIR exit rpm_file="munch-$VERSION-$ITERATION.x86_64.rpm" if [ $ok -eq 0 -a -f "$rpm_file" ]; then rm -f "$RPM_DIR/munch-*.rpm" cp "$rpm_file" "$RPM_DIR" (cd "$RPM_DIR" && \ createrepo -v . && \ rsync -av --progress --delete . fender.spyz.org:/srv/http-vhosts/rpm.scraperwall.com/) fi