dpkg debian package for general and BA tag
This commit is contained in:
26
makefile
26
makefile
@@ -12,14 +12,17 @@ ARMPLATFORM = aarch64
|
||||
GitLocalRoot = $(HOME)/omc.git
|
||||
EmsBuildRoot=$(GitLocalRoot)/build.ems
|
||||
BuildDir = $(EmsBuildRoot)/build
|
||||
CustomizedDir = $(EmsBuildRoot)/customized
|
||||
BuildOMCDir = $(BuildDir)/usr/local/omc
|
||||
BuildOMCBinDir = $(BuildOMCDir)/bin
|
||||
BuildOMCEtcDir = $(BuildOMCDir)/etc
|
||||
BuildLibDir = $(BuildDir)/lib
|
||||
BuildLibSystemDir = $(BuildLibDir)/systemd/system
|
||||
DebBuildDir = $(EmsBuildRoot)/debbuild
|
||||
DebBuildOMCDir = $(EmsBuildRoot)/debbuild/usr/local/omc
|
||||
DebFEBuildDir = $(EmsBuildRoot)/debbuild/usr/local/omc/htdocs
|
||||
DebBuild2204Dir = $(EmsBuildRoot)/debbuild/22.04
|
||||
DebBuild2204OMCDir = $(EmsBuildRoot)/debbuild/22.04/usr/local/omc
|
||||
DebFEBuild2204Dir = $(EmsBuildRoot)/debbuild/22.04/usr/local/omc/htdocs
|
||||
RpmBuildDir = $(EmsBuildRoot)/rpmbuild
|
||||
RpmFEBuildDir = $(RpmBuildDir)/BUILD/usr/local/omc/htdocs
|
||||
@@ -54,11 +57,14 @@ RestagentSize = 29525312
|
||||
BinWriterDir = $(HOME)/bin
|
||||
ifeq ($(shell grep VERSION_ID /etc/os-release), VERSION_ID="22.04")
|
||||
DebBuildDir := $(DebBuild2204Dir)
|
||||
DebBuildOMCDir := $(DebBuild2204OMCDir)
|
||||
DebFEBuildDir := $(DebFEBuild2204Dir)
|
||||
#DebPkgFile := $(PROJECT)-$(VERSION)-22.04-$(Release).$(PLATFORM).deb
|
||||
DebPkgFile := $(PROJECT)-r$(VERSION)-$(Release)-ub22.deb
|
||||
DebPkgFileBA := $(PROJECT)-r$(VERSION)-$(Release)-ub22-ba.deb
|
||||
else ifeq ($(shell grep VERSION_ID /etc/os-release), VERSION_ID="18.04")
|
||||
DebPkgFile := $(PROJECT)-r$(VERSION)-$(Release)-ub18.deb
|
||||
DebPkgFileBA := $(PROJECT)-r$(VERSION)-$(Release)-ub18-ba.deb
|
||||
endif
|
||||
|
||||
.PHONY: all $(RESTAGENT) $(CRONTASK) $(SshSvcBin) $(CapTraceBin) $(Data2htmlBin)
|
||||
@@ -101,7 +107,7 @@ dist:
|
||||
--exclude=../crontask/crontask \
|
||||
--exclude=../initems/initems
|
||||
|
||||
deb: $(BINNAME)
|
||||
prep_deb: $(BINNAME)
|
||||
# clear build cache
|
||||
rm -rf $(FrontBuildDir)/front/*
|
||||
rm -rf $(DebFEBuildDir)/front/*
|
||||
@@ -123,6 +129,14 @@ deb: $(BINNAME)
|
||||
chmod 755 $(DebBuildDir)/DEBIAN/postinst
|
||||
chmod 755 $(DebBuildDir)/DEBIAN/postrm
|
||||
cp -rf $(BuildDir)/* $(DebBuildDir)/
|
||||
|
||||
replace_chinese:
|
||||
@find $(DebBuildOMCDir)/etc/db -type f -name '*.sql' -exec sed -i '' 's/[一-龥]//g' {} +
|
||||
@echo "Replace all chinese charecter."
|
||||
|
||||
deb: prep_deb
|
||||
cp -rf $(CustomizedDir)/agt.d $(DebBuildOMCDir)/static
|
||||
cp -rf $(CustomizedDir)/omc.d $(DebBuildOMCDir)/static
|
||||
#cp -rf $(BuildDir)/nginx/* $(DebBuildDir)/etc/nginx/conf.d
|
||||
#cp -rf $(BuildDir)/systemd/*.service $(DebBuildDir)/lib/systemd/system/
|
||||
chmod +x $(DebBuildDir)/usr/local/omc/bin/*
|
||||
@@ -131,6 +145,16 @@ deb: $(BINNAME)
|
||||
perl -0777 -i -pe 's/ne:\n user: root/ne:\n user: omcuser/g' $(DebBuildDir)/usr/local/omc/etc/default/restconf.yaml
|
||||
dpkg -b $(DebBuildDir) $(ReleaseDebs)/$(DebPkgFile)
|
||||
|
||||
ba-deb: prep_deb replace_chinese
|
||||
cp -rf $(CustomizedDir)/ba.d $(DebBuildOMCDir)/static
|
||||
#cp -rf $(BuildDir)/nginx/* $(DebBuildDir)/etc/nginx/conf.d
|
||||
#cp -rf $(BuildDir)/systemd/*.service $(DebBuildDir)/lib/systemd/system/
|
||||
chmod +x $(DebBuildDir)/usr/local/omc/bin/*
|
||||
#sed -i.bak 's/YYYYMMDD/$(shell date +"%Y%m%d")/g' $(DebBuildDir)/DEBIAN/control
|
||||
sed -i 's/YYYYMMDD/$(shell date +"%Y%m%d")/g' $(DebBuildDir)/DEBIAN/control
|
||||
perl -0777 -i -pe 's/ne:\n user: root/ne:\n user: omcuser/g' $(DebBuildDir)/usr/local/omc/etc/default/restconf.yaml
|
||||
dpkg -b $(DebBuildDir) $(ReleaseDebs)/$(DebPkgFileBA)
|
||||
|
||||
rpm: $(BINNAME)
|
||||
# clear build cache
|
||||
rm -rf $(FrontBuildDir)/front/*
|
||||
|
||||
Reference in New Issue
Block a user