Skip to content

Commit

Permalink
omd: make packages upgradable
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Dec 20, 2018
1 parent 0acf1fa commit 183c569
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ rpm:
sed -e 's/^Requires:.*/Requires: $(OS_PACKAGES)/' \
-e 's/%{version}/$(OMD_VERSION)/g' \
-e 's/^Version:.*/Version: $(DISTRO_CODE)/' \
-e 's/^Release:.*/Release: $(OMD_SERIAL)/' \
-e 's/^Release:.*/Release: $(OMD_PATCH_LEVEL)/' \
-e 's#@APACHE_CONFDIR@#$(APACHE_CONF_DIR)#g' \
-e 's#@APACHE_NAME@#$(APACHE_NAME)#g' \
-e 's#@APACHE_INCLUDEOPT@#$(APACHE_INCLUDEOPT)#g' \
Expand Down Expand Up @@ -294,7 +294,7 @@ deb-changelog: deb-environment
# this is a hack!
rm -f debian/changelog
dch --create --package omd-$(OMD_VERSION) \
--newversion 0.$(DISTRO_CODE) "`cat debian/changelog.tmpl`"
--newversion $(OMD_PATCH_LEVEL).$(DISTRO_CODE) "`cat debian/changelog.tmpl`"
dch --release "releasing ...."

deb: deb-changelog
Expand Down Expand Up @@ -345,6 +345,7 @@ version:
if [ -n "$$newversion" ] && [ "$$newversion" != "$(OMD_VERSION)" ]; then \
sed -ri 's/^(OMD_VERSION[[:space:]]*= *).*/\1'"$$newversion/" Makefile.omd ; \
sed -ri 's/^(OMD_SERIAL[[:space:]]*= *).*/\1'"$(NEWSERIAL)/" Makefile.omd ; \
sed -ri 's/^(OMD_PATCH_LEVEL[[:space:]]*= *).*/\1'"1/" Makefile.omd ; \
sed -ri 's/^(OMD_VERSION[[:space:]]*= *).*/\1"'"$$newversion"'"/' packages/omd/omd ; \
fi ;

Expand Down
1 change: 1 addition & 0 deletions Makefile.omd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

OMD_VERSION = 2.90-labs-edition
OMD_SERIAL = 47
OMD_PATCH_LEVEL = 1 # increase when creating servicepack releases
OMD_BASE = /omd
OMD_PHYSICAL_BASE = /opt/omd
OMD_ROOT = $(OMD_BASE)/versions/$(OMD_VERSION)
Expand Down
3 changes: 3 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# do not build dbgsym packages
DEB_DH_STRIP_ARGS := --no-automatic-dbgsym

_PWD=`pwd`

include Makefile.omd
Expand Down
9 changes: 5 additions & 4 deletions omd.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,7 @@ setsebool -P httpd_can_network_connect on >/dev/null 2>&1
exit 0

%preun
# ON UNINSTALL: Make sure no sites use that version
# Do not check this on new release of the same OMD version
# (I know this has not happend yet in official releases, but might
# happen in future? At least I had such a case with my own builds now.)
# on run if uninstalled, not during updates
if [ $1 = 0 ] ; then
for link in /omd/sites/*/version
do
Expand All @@ -197,6 +194,8 @@ exit 0


%postun
# on run if uninstalled, not during updates
if [ $1 = 0 ] ; then
# sles12 sometimes does not remove some empty folders
rm -rf /omd/versions/%{version}
rm -f /omd/versions/default
Expand Down Expand Up @@ -245,4 +244,6 @@ else
echo "#> setsebool -P httpd_can_network_connect off"
fi
fi
fi
exit 0

0 comments on commit 183c569

Please sign in to comment.