pmt: Use timestamp instead of architecture in xz package name and use sudo when creating deb package

This commit is contained in:
2024-07-22 08:52:42 +03:00
parent 7eb6289726
commit b834134221
3 changed files with 11 additions and 3 deletions

0
SETUP-DEBS.md Normal file → Executable file
View File

View File

@@ -31,6 +31,14 @@ else ifeq ($(FOR_THIS),32)
DEB_ARCH_NAME := armeabi-v7a
endif
ifneq ($(wildcard /dev/block/by-name),)
SUDO := su
else ifeq ($(wildcard /system/build.prop),)
SUDO := sudo
else
SUDO :=
endif
# controls the presence of file/directory. usage: $(call check_local,<FILE_OR_DIRECTORY_PATH>,<PACKAGE_STAT: 1, NULL>)
define check_local
# the first argument is taken and controlled by the file/directory with -e option
@@ -90,7 +98,7 @@ all:
cp $(BINARY_DIR)/$(TARGET) $(DEBTERMUX_USR)/bin || abort; \
printf " - Starting dpkg-deb...\n"; \
sleep 2; \
chmod -R 755 *; \
$(SUDO) chmod -R 755 *; \
dpkg-deb -b $(TEMP_DIR) $(DEB_DIR)/$(TARGET)-$(DEB_ARCH_NAME).deb || abort; \
# cleanup template directory
rm -rf $(TEMP_DIR); \

View File

@@ -134,10 +134,10 @@ all:
mv *.a $(STATICLIB_DIR) || abort_build; \
printf "\n - Generating package...\n"; \
cp $(BINARY_DIR)/$(TARGET) $(PACKAGE_DIR) || abort_build; \
printf " XZ $(OUT_DIRNAME)/package/$(TARGET)-$(ARCH).xz"
printf " XZ $(OUT_DIRNAME)/package/$(TARGET)-`date +%Y%m%d`.xz"
xz $(PACKAGE_DIR)/$(TARGET) || abort_build; \
sleep 1; \
mv $(PACKAGE_DIR)/$(TARGET).xz $(PACKAGE_DIR)/$(TARGET)-$(ARCH).xz || abort_build; \
mv $(PACKAGE_DIR)/$(TARGET).xz $(PACKAGE_DIR)/$(TARGET)-`date +%Y%m%d`.xz || abort_build; \
printf "\n - Success"; \
sleep 1; \
printf "\n\n ----------------------------------- \n"