Added debian build (WIP)
This commit is contained in:
parent
d3659cb51a
commit
5b57f12365
9 changed files with 83 additions and 57 deletions
91
Makefile
91
Makefile
|
@ -1,12 +1,18 @@
|
||||||
# Variables
|
# Variables
|
||||||
PHPCC := $(shell which php)
|
PHPCC := $(shell which php)
|
||||||
PHPAB := $(shell which phpab)
|
PHPAB := $(shell which phpab)
|
||||||
|
DEBPKG := $(shell which dpkg-deb)
|
||||||
SRC_PATH := src
|
SRC_PATH := src
|
||||||
INSTALLER_PATH := $(SRC_PATH)/installer
|
ASSETS_PATH := assets
|
||||||
|
INSTALLER_SRC_PATH := $(SRC_PATH)/installer
|
||||||
CONFIG_PATH := $(SRC_PATH)/config
|
CONFIG_PATH := $(SRC_PATH)/config
|
||||||
TIMESTAMP := $(shell date +%Y%m%d%H%M%S)
|
|
||||||
BUILD_VERSION := $(shell cat $(SRC_PATH)/ncc/VERSION)
|
BUILD_VERSION := $(shell cat $(SRC_PATH)/ncc/VERSION)
|
||||||
BUILD_PATH := build/ncc-$(BUILD_VERSION)
|
BUILD_PATH := build
|
||||||
|
GENERIC_BUILD_PATH := $(BUILD_PATH)/ncc_$(BUILD_VERSION)
|
||||||
|
TAR_BUILD:= ncc_$(BUILD_VERSION).tar.gz
|
||||||
|
DEBIAN_SRC_PATH := $(SRC_PATH)/debian
|
||||||
|
DEBIAN_BUILD_PATH := $(BUILD_PATH)/debian/ncc_$(BUILD_VERSION)_all
|
||||||
|
DEBIAN_PACKAGE_BUILD_PATH := $(BUILD_PATH)/ncc_$(BUILD_VERSION)_all.deb
|
||||||
|
|
||||||
# List of paths for autoloading
|
# List of paths for autoloading
|
||||||
AUTOLOAD_PATHS := $(addprefix $(SRC_PATH)/ncc/ThirdParty/, \
|
AUTOLOAD_PATHS := $(addprefix $(SRC_PATH)/ncc/ThirdParty/, \
|
||||||
|
@ -57,31 +63,63 @@ autoload: $(addsuffix /autoload_spl.php, $(AUTOLOAD_PATHS)) $(SRC_PATH)/ncc/auto
|
||||||
|
|
||||||
.PHONY: redist
|
.PHONY: redist
|
||||||
redist: autoload
|
redist: autoload
|
||||||
rm -rf $(BUILD_PATH)
|
rm -rf $(GENERIC_BUILD_PATH)
|
||||||
mkdir -p $(BUILD_PATH)
|
mkdir -p $(GENERIC_BUILD_PATH)
|
||||||
cp -rf $(SRC_PATH)/ncc/* $(BUILD_PATH)
|
cp -rf $(SRC_PATH)/ncc/* $(GENERIC_BUILD_PATH)
|
||||||
cp -f $(INSTALLER_PATH)/installer $(BUILD_PATH)/INSTALL
|
cp -f $(INSTALLER_SRC_PATH)/installer $(GENERIC_BUILD_PATH)/INSTALL
|
||||||
cp -f $(INSTALLER_PATH)/ncc.sh $(BUILD_PATH)/ncc.sh
|
cp -f $(INSTALLER_SRC_PATH)/ncc.sh $(GENERIC_BUILD_PATH)/ncc.sh
|
||||||
cp -f $(CONFIG_PATH)/ncc.yaml $(BUILD_PATH)/default_config.yaml
|
cp -f $(CONFIG_PATH)/ncc.yaml $(GENERIC_BUILD_PATH)/default_config.yaml
|
||||||
cp -f $(CONFIG_PATH)/ncc.yaml $(BUILD_PATH)/CLI/template_config.yaml
|
cp -f $(CONFIG_PATH)/ncc.yaml $(GENERIC_BUILD_PATH)/CLI/template_config.yaml
|
||||||
cp -f $(CONFIG_PATH)/default_repositories.json $(BUILD_PATH)/default_repositories.json
|
cp -f $(CONFIG_PATH)/default_repositories.json $(GENERIC_BUILD_PATH)/default_repositories.json
|
||||||
cp -f $(CONFIG_PATH)/ncc-package.xml $(BUILD_PATH)/ncc-package.xml
|
cp -f $(INSTALLER_SRC_PATH)/ncc-package.xml $(GENERIC_BUILD_PATH)/ncc-package.xml
|
||||||
cp -f $(INSTALLER_PATH)/extension $(BUILD_PATH)/extension
|
cp -f $(INSTALLER_SRC_PATH)/extension $(GENERIC_BUILD_PATH)/extension
|
||||||
chmod +x $(BUILD_PATH)/INSTALL
|
chmod +x $(GENERIC_BUILD_PATH)/INSTALL
|
||||||
cp -f LICENSE $(BUILD_PATH)/LICENSE
|
cp -f LICENSE $(GENERIC_BUILD_PATH)/LICENSE
|
||||||
cp -f README.md $(BUILD_PATH)/README.md
|
cp -f README.md $(GENERIC_BUILD_PATH)/README.md
|
||||||
cp -f $(INSTALLER_PATH)/hash_check.php $(BUILD_PATH)/hash_check.php
|
cp -f $(INSTALLER_SRC_PATH)/hash_check.php $(GENERIC_BUILD_PATH)/hash_check.php
|
||||||
$(PHPCC) $(BUILD_PATH)/hash_check.php
|
$(PHPCC) $(GENERIC_BUILD_PATH)/hash_check.php
|
||||||
rm $(BUILD_PATH)/hash_check.php
|
rm $(GENERIC_BUILD_PATH)/hash_check.php
|
||||||
cp -f $(INSTALLER_PATH)/generate_build_files.php $(BUILD_PATH)/generate_build_files.php
|
cp -f $(INSTALLER_SRC_PATH)/generate_build_files.php $(GENERIC_BUILD_PATH)/generate_build_files.php
|
||||||
$(PHPCC) $(BUILD_PATH)/generate_build_files.php
|
$(PHPCC) $(GENERIC_BUILD_PATH)/generate_build_files.php
|
||||||
rm $(BUILD_PATH)/generate_build_files.php
|
rm $(GENERIC_BUILD_PATH)/generate_build_files.php
|
||||||
|
|
||||||
$(BUILD_PATH)/build_$(TIMESTAMP).tar.gz: redist
|
.PHONY: debian_prepare
|
||||||
cd $(BUILD_PATH); tar -czvf ../ncc_$(BUILD_VERSION).tar.gz *
|
debian_prepare: autoload
|
||||||
|
rm -rf $(DEBIAN_BUILD_PATH)
|
||||||
|
mkdir -p $(DEBIAN_BUILD_PATH)
|
||||||
|
mkdir -p $(DEBIAN_BUILD_PATH)/DEBIAN
|
||||||
|
mkdir -p $(DEBIAN_BUILD_PATH)/usr/share/ncc
|
||||||
|
cp -rf $(SRC_PATH)/ncc/* $(DEBIAN_BUILD_PATH)/usr/share/ncc
|
||||||
|
cp -rf $(INSTALLER_SRC_PATH)/ncc.sh $(DEBIAN_BUILD_PATH)/usr/share/ncc/ncc.sh
|
||||||
|
chmod +x $(DEBIAN_BUILD_PATH)/usr/share/ncc/ncc.sh
|
||||||
|
cp -rf $(CONFIG_PATH)/ncc.yaml $(DEBIAN_BUILD_PATH)/usr/share/ncc/default_config.yaml
|
||||||
|
cp -rf $(CONFIG_PATH)/ncc.yaml $(DEBIAN_BUILD_PATH)/usr/share/ncc/CLI/template_config.yaml
|
||||||
|
cp -rf $(CONFIG_PATH)/default_repositories.json $(DEBIAN_BUILD_PATH)/usr/share/ncc/default_repositories.json
|
||||||
|
cp -f LICENSE $(DEBIAN_BUILD_PATH)/usr/share/ncc/LICENSE
|
||||||
|
mkdir -p $(DEBIAN_BUILD_PATH)/usr/share/mime/packages
|
||||||
|
cp -rf $(INSTALLER_SRC_PATH)/ncc-package.xml $(DEBIAN_BUILD_PATH)/usr/share/mime/packages/ncc-package.xml
|
||||||
|
mkdir -p $(DEBIAN_BUILD_PATH)/usr/share/applications
|
||||||
|
cp -rf $(INSTALLER_SRC_PATH)/ncc.desktop $(DEBIAN_BUILD_PATH)/usr/share/applications/ncc.desktop
|
||||||
|
mkdir -p $(DEBIAN_BUILD_PATH)/usr/share/icons
|
||||||
|
cp -rf $(ASSETS_PATH)/icon/ncc@256px.png $(DEBIAN_BUILD_PATH)/usr/share/icons/ncc.png
|
||||||
|
cp -rf $(INSTALLER_SRC_PATH)/hash_check.php $(DEBIAN_BUILD_PATH)/usr/share/ncc/hash_check.php
|
||||||
|
cp -rf $(DEBIAN_SRC_PATH)/control $(DEBIAN_BUILD_PATH)/DEBIAN/control
|
||||||
|
cp -rf $(DEBIAN_SRC_PATH)/postinst $(DEBIAN_BUILD_PATH)/DEBIAN/postinst
|
||||||
|
chmod +x $(DEBIAN_BUILD_PATH)/DEBIAN/postinst
|
||||||
|
cp -rf $(DEBIAN_SRC_PATH)/copyright $(DEBIAN_BUILD_PATH)/DEBIAN/copyright
|
||||||
|
|
||||||
|
|
||||||
|
$(BUILD_PATH)/$(TAR_BUILD): redist
|
||||||
|
cd $(GENERIC_BUILD_PATH) && tar -czf ../$(TAR_BUILD) *
|
||||||
|
|
||||||
.PHONY: tar
|
.PHONY: tar
|
||||||
tar: $(BUILD_PATH)/build_$(TIMESTAMP).tar.gz
|
tar: $(BUILD_PATH)/$(TAR_BUILD)
|
||||||
|
|
||||||
|
$(DEBIAN_PACKAGE_BUILD_PATH): debian_prepare
|
||||||
|
$(DEBPKG) --build $(DEBIAN_BUILD_PATH) $(DEBIAN_PACKAGE_BUILD_PATH)
|
||||||
|
|
||||||
|
.PHONY: deb
|
||||||
|
deb: $(DEBIAN_PACKAGE_BUILD_PATH)
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
@ -94,5 +132,6 @@ help:
|
||||||
@echo "Available commands:"
|
@echo "Available commands:"
|
||||||
@echo " make autoload - Generate autoload files"
|
@echo " make autoload - Generate autoload files"
|
||||||
@echo " make redist - Prepare the project for redistribution"
|
@echo " make redist - Prepare the project for redistribution"
|
||||||
@echo " make tar - Package the project into a tarball with timestamp"
|
@echo " make tar - Package the project into a tarball (Generic installer, requires php)"
|
||||||
|
@echo " make deb - Package the project into a Debian package"
|
||||||
@echo " make clean - Clean the build artifacts"
|
@echo " make clean - Clean the build artifacts"
|
|
@ -1,9 +0,0 @@
|
||||||
ncc (2.0.0) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New major release.
|
|
||||||
* Various changes and improvements.
|
|
||||||
* Updated to be compatible with PHP 8.0+.
|
|
||||||
* Added support for package management.
|
|
||||||
* Enhancements to the compiler and toolkit.
|
|
||||||
|
|
||||||
-- netkas <netkas@nosial.net> Tue, 04 Oct 2023 21:24:00 +0000
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
Package: ncc
|
||||||
Source: ncc
|
Source: ncc
|
||||||
Section: devel
|
Section: devel
|
||||||
Priority: optional
|
Priority: optional
|
||||||
|
@ -8,10 +9,10 @@ Standards-Version: 4.5.1
|
||||||
Homepage: https://git.n64.cc/nosial/ncc
|
Homepage: https://git.n64.cc/nosial/ncc
|
||||||
Vcs-Git: https://git.n64.cc/nosial/ncc.git
|
Vcs-Git: https://git.n64.cc/nosial/ncc.git
|
||||||
Vcs-Browser: https://git.n64.cc/nosial/ncc
|
Vcs-Browser: https://git.n64.cc/nosial/ncc
|
||||||
|
Name: Nosial Code Compiler
|
||||||
Package: ncc
|
Architecture: all
|
||||||
Architecture: any
|
|
||||||
Depends: php (>= 8.0), php-mbstring, php-common, php-ctype, php-curl, zlib1g, php-zip
|
Depends: php (>= 8.0), php-mbstring, php-common, php-ctype, php-curl, zlib1g, php-zip
|
||||||
Description: Nosial Code Compiler is a multi-purpose compiler, package manager, and toolkit written in PHP.
|
Description: Nosial Code Compiler is a multi-purpose compiler, package manager, and toolkit written in PHP.
|
||||||
NCC (Nosial Code Compiler) is a versatile tool designed for various tasks related to PHP development.
|
NCC (Nosial Code Compiler) is a versatile tool designed for various tasks related to PHP development.
|
||||||
It allows you to compile PHP code, manage packages, and perform various tasks in a PHP-centric environment.
|
It allows you to compile PHP code, manage packages, and perform various tasks in a PHP-centric environment.
|
||||||
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
# compile and make ta
|
|
||||||
cd ..
|
|
||||||
make redist tar
|
|
||||||
|
|
||||||
# extract compiled tar to /usr/share/ncc directory
|
|
||||||
sudo mkdir -p /usr/share/ncc
|
|
||||||
sudo tar -xzvf build/ncc_2.0.0.tar.gz -C /usr/share/ncc/
|
|
2
src/debian/postinst
Normal file
2
src/debian/postinst
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
update-mime-database /usr/share/mime
|
|
@ -1,9 +0,0 @@
|
||||||
#!/usr/bin/make -f
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
|
||||||
# Run the custom install script from debian directory
|
|
||||||
$(CURDIR)/debian/install.sh
|
|
||||||
dh_auto_install
|
|
|
@ -1 +0,0 @@
|
||||||
3.0 (native)
|
|
12
src/installer/ncc.desktop
Normal file
12
src/installer/ncc.desktop
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Version=1.0
|
||||||
|
Name=ncc
|
||||||
|
GenericName=Nosial Code Compiler
|
||||||
|
Comment=Nosial Code Compiler
|
||||||
|
Exec=/usr/bin/ncc
|
||||||
|
TryExec=/usr/bin/ncc
|
||||||
|
Icon=/usr/share/icons/ncc.png
|
||||||
|
Terminal=true
|
||||||
|
Type=Application
|
||||||
|
Categories=Development;
|
||||||
|
Keywords=compiler;code
|
Loading…
Add table
Reference in a new issue