github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/make-release (about) 1 #!/bin/sh 2 3 ROOT="`pwd`/build" 4 mkdir -p $ROOT 5 6 after_install_script="$ROOT/after_install.sh" 7 RPMROOT="$ROOT/rpmbuild" 8 DEBROOT="$ROOT/debbuild" 9 10 cat > $after_install_script << EOF 11 systemctl daemon-reload 12 EOF 13 14 VERSION=$(cat VERSION) 15 16 BIN="$RPMROOT/usr/bin" 17 CONF="$RPMROOT/etc/eru" 18 SERVICE="$RPMROOT/usr/lib/systemd/system" 19 20 mkdir -p $BIN 21 mkdir -p $CONF 22 mkdir -p $SERVICE 23 24 # calc iteration number 25 ITRATION_FILE=.${VERSION}.itr 26 if [ ! -f $ITRATION_FILE ]; then 27 echo 0 > $ITRATION_FILE 28 fi 29 ITRATION_NUMBER=$(cat $ITRATION_FILE) 30 if [ $ITRATION_NUMBER -lt 0 ]; then 31 ITRATION_NUMBER=0 32 fi 33 # increase every calling 34 ITRATION_NUMBER=$(expr $ITRATION_NUMBER + 1) 35 echo $ITRATION_NUMBER > $ITRATION_FILE 36 37 cp eru-core $BIN 38 cp core.yaml.sample $CONF 39 cp eru-core.service $SERVICE 40 41 echo $VERSION rpm build begin 42 43 fpm -f -s dir -t rpm -n eru-core --epoch 0 -v $VERSION --iteration ${ITRATION_NUMBER}.el7 -C $RPMROOT -p $PWD --verbose --no-rpm-auto-add-directories --category 'Development/App' --description 'eru core' --after-install $after_install_script --url 'https://github.com/projecteru2/core' --license 'MIT' -a all --no-rpm-sign usr etc 44 45 BIN="$DEBROOT/usr/bin" 46 CONF="$DEBROOT/etc/eru" 47 SERVICE="$DEBROOT/lib/systemd/system" 48 49 mkdir -p $BIN 50 mkdir -p $CONF 51 mkdir -p $SERVICE 52 53 cp eru-core $BIN 54 cp core.yaml.sample $CONF 55 cp eru-core.service $SERVICE 56 57 echo $VERSION deb build begin 58 59 fpm -f -s dir -t deb -n eru-core -v $VERSION --iteration ${ITRATION_NUMBER}.noarch -C $DEBROOT -p $PWD --verbose --category 'Development/App' --description 'eru core' --url 'https://github.com/projecteru2/core' --license 'MIT' --after-install $after_install_script --deb-no-default-config-files usr etc lib 60 61 rm -rf $ROOT