changed permissions, another var created, comments removed
This commit is contained in:
55
install.sh
55
install.sh
@@ -2,12 +2,13 @@
|
||||
set -e -x
|
||||
|
||||
NAME="server22"
|
||||
PATH_USR="/tmp/$NAME/usr"
|
||||
PATH_TMP="/tmp/$NAME"
|
||||
PATH_USR="$PATH_TMP/usr"
|
||||
# Deletes server22 dir from /tmp if exists (that was for testing)
|
||||
sudo rm -rf /tmp/$NAME
|
||||
sudo rm -rf $PATH_TMP
|
||||
|
||||
# Python installation executed, for debian layout and install it to /tmp/server22
|
||||
python3 setup.py install --install-layout deb --root /tmp/$NAME
|
||||
python3 setup.py install --install-layout deb --root $PATH_TMP
|
||||
|
||||
# Remove .egg-info and build dir from root folder
|
||||
sudo rm -rf ./src/$NAME.egg-info
|
||||
@@ -17,7 +18,7 @@ sudo rm -rf ./build
|
||||
tree
|
||||
|
||||
# Copy /DEBIAN to /tmp/$NAME
|
||||
sudo cp -R ./DEBIAN /tmp/$NAME
|
||||
sudo cp -R ./DEBIAN $PATH_TMP
|
||||
|
||||
# Deletes __pycache__ from /tmp/$NAME
|
||||
sudo rm -r $PATH_USR/lib/python3/dist-packages/$NAME/__pycache__
|
||||
@@ -27,52 +28,26 @@ mkdir $PATH_USR/share/
|
||||
mkdir $PATH_USR/share/doc
|
||||
mkdir $PATH_USR/share/doc/$NAME/
|
||||
|
||||
# Add copyright and changelog.gz in created dir (It has to be done for debian packaging)
|
||||
#touch $PATH_USR/share/doc/$NAME/copyright # TODO: make both files in root folder, copy them, and changelog here to .gz
|
||||
#touch $PATH_USR/share/doc/$NAME/changelog.gz
|
||||
|
||||
# Copy share folder with subdirs to PATH_USR
|
||||
sudo cp -r -v share $PATH_USR
|
||||
#sudo cp share/doc/server22/changelog PATH_USR
|
||||
|
||||
cd $PATH_USR/share/doc/server22 && sudo gzip -9 -n changelog
|
||||
# Zip the changelog
|
||||
sudo gzip -9 -n $PATH_USR/share/doc/server22/changelog
|
||||
# Change owners
|
||||
sudo chown -R 0:50 /tmp/$NAME
|
||||
sudo chown -R 0:50 $PATH_TMP
|
||||
sudo chown -R 0:0 $PATH_USR/share
|
||||
|
||||
sudo chmod 0775 $PATH_USR
|
||||
#sudo chmod -R 0775 $PATH_USR/bin
|
||||
#sudo chmod -R 0775 $PATH_USR/lib
|
||||
|
||||
# SOME TRY TO GET RID OF LINTIAN WARNINGS - NOT WORKING :/
|
||||
# sudo chmod 0644 $PATH_USR/share/doc/$NAME/copyright
|
||||
# sudo chmod 0644 $PATH_USR/share/doc/$NAME/changelog.gz
|
||||
|
||||
# # Change permissions
|
||||
# sudo chmod -R 0775 $PATH_USR
|
||||
# #sudo chmod 0644 -R $PATH_USR/share/doc/$NAME
|
||||
# sudo chmod -x $PATH_USR/share/doc/$NAME/changelog.gz
|
||||
|
||||
# #sudo chmod 0644 $PATH_USR/share/doc/$NAME/changelog.gz
|
||||
# # Change owners
|
||||
# sudo chown -R 0:50 /tmp/$NAME
|
||||
|
||||
# sudo chown -R 0:0 $PATH_USR/share
|
||||
# #sudo chmod -R 0644 $PATH_USR/share #TODO
|
||||
|
||||
# tree /tmp/$NAME
|
||||
|
||||
# # Change permissions
|
||||
# sudo chmod -R 0775 $PATH_USR
|
||||
# #sudo chmod -R 0644 $PATH_USR/share
|
||||
# Delete write permissions from group
|
||||
sudo chmod -R g-w $PATH_USR
|
||||
|
||||
# Show actual tree of /tmp/$NAME dir to the user
|
||||
tree /tmp/$NAME
|
||||
tree $PATH_TMP
|
||||
|
||||
# dpkg will pack this modified folder to .deb
|
||||
dpkg -b /tmp/$NAME
|
||||
dpkg -b $PATH_TMP
|
||||
|
||||
# Show lintian output to the user. If there will be some red E, means that installation was not successful
|
||||
lintian -c /tmp/$NAME.deb
|
||||
lintian -c $PATH_TMP.deb
|
||||
|
||||
# Rename .deb package (name_of_the_package-version-binary)
|
||||
dpkg-name -o /tmp/$NAME.deb
|
||||
dpkg-name -o $PATH_TMP.deb
|
||||
|
||||
Reference in New Issue
Block a user