[rpm] move common files to package directory

Signed-off-by: Leo Chen <leo@harmony.one>
pull/3309/head
Leo Chen 4 years ago
parent 7218ca135e
commit 7bf3acafe4
  1. 14
      Makefile
  2. 0
      scripts/package/harmony-setup.sh
  3. 0
      scripts/package/harmony-sysctl.conf
  4. 4
      scripts/package/harmony.service
  5. 16
      scripts/package/rpm/harmony.spec

@ -93,14 +93,16 @@ rpm_init: bin/harmony
mkdir -p $(RPMBUILD)/{SOURCES,SPECS,BUILD,RPMS,BUILDROOT,SRPMS}
mkdir -p $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)
cp -f bin/harmony $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)
bin/harmony dumpconfig $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)/harmony.cfg
cp -f scripts/rpm/harmony.service $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)
cp -f scripts/rpm/harmony-setup.sh $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)
cp -f scripts/rpm/harmony-sysctl.conf $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)
cp -f scripts/rpm/harmony.spec $(RPMBUILD)/SPECS
bin/harmony dumpconfig $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)/harmony.conf
cp -f scripts/package/harmony.service $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)
cp -f scripts/package/harmony-setup.sh $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)
cp -f scripts/package/harmony-rclone.sh $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)
cp -f scripts/package/rclone.conf $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)
cp -f scripts/package/harmony-sysctl.conf $(RPMBUILD)/SOURCES/$(PKGNAME)-$(VERSION)
cp -f scripts/package/rpm/harmony.spec $(RPMBUILD)/SPECS
(cd $(RPMBUILD)/SOURCES; tar cvf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION))
rpm_build:
rpmbuild --target x86_64 -bb scripts/rpm/harmony.spec
rpmbuild --target x86_64 -bb scripts/package/rpm/harmony.spec
rpm: rpm_init rpm_build

@ -7,8 +7,8 @@ Type=simple
Restart=on-failure
RestartSec=1
User=harmony
WorkingDirectory=/home/harmony
ExecStart=/usr/local/sbin/harmony -c /etc/harmony/harmony.cfg
WorkingDirectory=/data/harmony
ExecStart=/usr/local/sbin/harmony -c /etc/harmony/harmony.conf
StandardError=syslog
SyslogIdentifier=harmony
StartLimitInterval=0

@ -39,20 +39,24 @@ exit 0
%pre
getent group harmony >/dev/null || groupadd -r harmony
getent passwd harmony >/dev/null || \
useradd -r -g harmony -d /home/harmony -m -s /sbin/nologin \
useradd -r -g harmony -d /data/harmony -m -s /sbin/nologin \
-c "Harmony validator node account" harmony
mkdir -p /home/harmony/.hmy/blskeys
chown -R harmony.harmony /home/harmony
mkdir -p /data/harmony/.hmy/blskeys
mkdir -p /data/harmony/.config/rclone
chown -R harmony.harmony /data/harmony
exit 0
%install
install -m 0755 -d ${RPM_BUILD_ROOT}/usr/local/sbin ${RPM_BUILD_ROOT}/etc/systemd/system ${RPM_BUILD_ROOT}/etc/sysctl.d ${RPM_BUILD_ROOT}/etc/harmony
install -m 0755 -d ${RPM_BUILD_ROOT}/data/harmony/.config/rclone
install -m 0755 harmony ${RPM_BUILD_ROOT}/usr/local/sbin/
install -m 0755 harmony-setup.sh ${RPM_BUILD_ROOT}/usr/local/sbin/
install -m 0755 harmony-rclone.sh ${RPM_BUILD_ROOT}/usr/local/sbin/
install -m 0644 rclone.conf ${RPM_BUILD_ROOT}/data/harmony/.config/rclone/
install -m 0644 harmony.service ${RPM_BUILD_ROOT}/etc/systemd/system/
install -m 0644 harmony-sysctl.conf ${RPM_BUILD_ROOT}/etc/sysctl.d/
install -m 0644 harmony.cfg ${RPM_BUILD_ROOT}/etc/harmony/
install -m 0644 harmony.conf ${RPM_BUILD_ROOT}/etc/harmony/
exit 0
%post
@ -68,9 +72,11 @@ exit 0
%files
/usr/local/sbin/harmony
/usr/local/sbin/harmony-setup.sh
/usr/local/sbin/harmony-rclone.sh
/etc/sysctl.d/harmony-sysctl.conf
/etc/systemd/system/harmony.service
/etc/harmony/harmony.cfg
/etc/harmony/harmony.conf
/data/harmony/.config/rclone
%doc
%license
Loading…
Cancel
Save