Deb/Rpm: all file copying to packages is done in debian/ atm

This commit is contained in:
Dmitry Maksyoma 2021-02-24 21:20:33 +13:00
parent 9301fe9d33
commit a865b6e6eb
2 changed files with 28 additions and 14 deletions

View File

@ -36,12 +36,6 @@ Simplicity - KasmVNC aims at being simple to deploy and configure.
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
DESTDIR=$RPM_BUILD_ROOT make -f /src/debian/Makefile.to_fakebuild_tar_package install DESTDIR=$RPM_BUILD_ROOT make -f /src/debian/Makefile.to_fakebuild_tar_package install
cd $RPM_BUILD_ROOT/usr/bin && mv Xkasmvnc Xvnc && \
mv kasmvncserver vncserver && mv kasmvncconfig vncconfig && \
ln -s kasmvncpasswd vncpasswd
cd $RPM_BUILD_ROOT/usr/share/man/man1 && mv Xkasmvnc.1 Xvnc.1 && \
mv kasmvncserver.1 vncserver.1 && mv kasmvncconfig.1 vncconfig.1 && \
cp kasmvncpasswd.1 vncpasswd.1
%files %files
/usr/bin/* /usr/bin/*

View File

@ -1,8 +1,10 @@
TARGET_OS := $(shell lsb_release -is | tr '[:upper:]' '[:lower:]') TARGET_OS := $(shell lsb_release -is | tr '[:upper:]' '[:lower:]')
TARGET_OS_CODENAME := $(shell lsb_release -cs | tr '[:upper:]' '[:lower:]') TARGET_OS_CODENAME := $(shell lsb_release -cs | tr '[:upper:]' '[:lower:]')
ifeq ($(TARGET_OS), $(filter $(TARGET_OS), centos fedora)) ifeq ($(TARGET_OS), $(filter $(TARGET_OS), centos fedora))
PACKAGE_TYPE := rpm
TARBALL_DIR := $$RPM_SOURCE_DIR TARBALL_DIR := $$RPM_SOURCE_DIR
else else
PACKAGE_TYPE := deb
TARBALL_DIR := builder/build TARBALL_DIR := builder/build
endif endif
TARBALL := $(TARBALL_DIR)/kasmvnc.$(TARGET_OS)_$(TARGET_OS_CODENAME).tar.gz TARBALL := $(TARBALL_DIR)/kasmvnc.$(TARGET_OS)_$(TARGET_OS_CODENAME).tar.gz
@ -16,18 +18,36 @@ install: unpack_tarball
echo "installing files" echo "installing files"
mkdir -p $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/man/man1 \ mkdir -p $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/man/man1 \
$(DESTDIR)/usr/share/doc/kasmvncserver $(DESTDIR)/usr/share/doc/kasmvncserver
cp $(SRC_BIN)/Xvnc $(DESTDIR)/usr/bin/Xkasmvnc if [ $(PACKAGE_TYPE) = deb ]; then \
cp $(SRC_BIN)/vncserver $(DESTDIR)/usr/bin/kasmvncserver cp $(SRC_BIN)/Xvnc $(DESTDIR)/usr/bin/Xkasmvnc; \
cp $(SRC_BIN)/vncconfig $(DESTDIR)/usr/bin/kasmvncconfig cp $(SRC_BIN)/vncserver $(DESTDIR)/usr/bin/kasmvncserver; \
cp $(SRC_BIN)/kasmvncpasswd $(DESTDIR)/usr/bin/ cp $(SRC_BIN)/vncconfig $(DESTDIR)/usr/bin/kasmvncconfig; \
cp $(SRC_BIN)/kasmvncpasswd $(DESTDIR)/usr/bin/; \
fi
if [ $(PACKAGE_TYPE) = rpm ]; then \
cp $(SRC_BIN)/Xvnc $(DESTDIR)/usr/bin; \
cp $(SRC_BIN)/vncserver $(DESTDIR)/usr/bin; \
cp $(SRC_BIN)/vncconfig $(DESTDIR)/usr/bin; \
cp $(SRC_BIN)/kasmvncpasswd $(DESTDIR)/usr/bin; \
cd $(DESTDIR)/usr/bin && ln -s kasmvncpasswd vncpasswd; \
fi
cp -r $(SRC)/share/doc/kasmvnc*/* $(DESTDIR)/usr/share/doc/kasmvncserver/ cp -r $(SRC)/share/doc/kasmvnc*/* $(DESTDIR)/usr/share/doc/kasmvncserver/
rsync -r --exclude '.git*' --exclude po2js --exclude xgettext-html \ rsync -r --exclude '.git*' --exclude po2js --exclude xgettext-html \
--exclude www/utils/ --exclude .eslintrc \ --exclude www/utils/ --exclude .eslintrc \
$(SRC)/share/kasmvnc $(DESTDIR)/usr/share $(SRC)/share/kasmvnc $(DESTDIR)/usr/share
cp $(SRC)/man/man1/Xvnc.1 $(DESTDIR)/usr/share/man/man1/Xkasmvnc.1 if [ $(PACKAGE_TYPE) = deb ]; then \
cp $(SRC)/share/man/man1/vncserver.1 $(DST_MAN)/kasmvncserver.1 cp $(SRC)/man/man1/Xvnc.1 $(DESTDIR)/usr/share/man/man1/Xkasmvnc.1; \
cp $(SRC)/share/man/man1/vncpasswd.1 $(DST_MAN)/kasmvncpasswd.1 cp $(SRC)/share/man/man1/vncserver.1 $(DST_MAN)/kasmvncserver.1; \
cp $(SRC)/share/man/man1/vncconfig.1 $(DST_MAN)/kasmvncconfig.1 cp $(SRC)/share/man/man1/vncpasswd.1 $(DST_MAN)/kasmvncpasswd.1; \
cp $(SRC)/share/man/man1/vncconfig.1 $(DST_MAN)/kasmvncconfig.1; \
fi
if [ $(PACKAGE_TYPE) = rpm ]; then \
cp $(SRC)/man/man1/Xvnc.1 $(DESTDIR)/usr/share/man/man1/; \
cp $(SRC)/share/man/man1/vncserver.1 $(DST_MAN); \
cp $(SRC)/share/man/man1/vncconfig.1 $(DST_MAN); \
cp $(SRC)/share/man/man1/vncpasswd.1 $(DST_MAN); \
cd $(DST_MAN) && ln -s vncpasswd.1 kasmvncpasswd.1; \
fi
unpack_tarball: unpack_tarball:
tar -xzf "$(TARBALL)" -C "$(TAR_DATA)" tar -xzf "$(TARBALL)" -C "$(TAR_DATA)"