Skip to content

Commit fefb094

Browse files
committed
Added Linux deb package generation.
1 parent cd636f3 commit fefb094

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

GNUmakefile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DYLIB_EXT = so
1616
LDFLAGS = -shared
1717
DYNAMIC_LIB := -shared -fPIC
1818
CXXFLAGS := $(CXXFLAGS) -lcurl -lssl -lcrypto
19-
PACKAGE :=
19+
PACKAGE := linux-package
2020
endif
2121

2222
LIBFILE := $(LIBNAME).$(DYLIB_EXT)
@@ -52,8 +52,27 @@ pkg: sqlwrite-bin
5252
pkgbuild --root pkg_root --identifier $(DOMAIN) --version 1.0 --install-location / sqlwrite-mac.pkg
5353
endif
5454

55+
# Packaging for Linux systems
56+
linux-package: sqlwrite-bin
57+
# Create the package directory structure
58+
mkdir -p pkg_root/usr/local/bin
59+
mkdir -p pkg_root/usr/local/lib
60+
cp sqlwrite-bin pkg_root/usr/local/bin
61+
cp $(LIBFILE) pkg_root/usr/local/lib
62+
cp $(SQLITE_LIB) pkg_root/usr/local/lib
63+
64+
mkdir -p DEBIAN
65+
echo "Package: sqlwrite" > DEBIAN/control
66+
echo "Version: 1.0" >> DEBIAN/control
67+
echo "Section: base" >> DEBIAN/control
68+
echo "Priority: optional" >> DEBIAN/control
69+
echo "Architecture: $(shell dpkg --print-architecture)" >> DEBIAN/control
70+
echo "Maintainer: your-email@example.com" >> DEBIAN/control
71+
echo "Description: Sqlwrite command-line tool" >> DEBIAN/control
72+
dpkg-deb --build pkg_root sqlwrite-linux.deb
73+
5574

5675
clean:
57-
rm -rf sqlwrite-mac.pkg sqlwrite $(LIBFILE) $(SQLITE_LIB)
76+
rm -rf sqlwrite-mac.pkg sqlwrite-linux.deb sqlwrite-bin $(LIBFILE) $(SQLITE_LIB)
5877

5978

0 commit comments

Comments
 (0)