Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,15 @@ uci_config.h
tests/shunit2/save
tests/cram/*.t.err
.venv

obj-*
debian/.debhelper/
debian/debhelper-build-stamp
debian/*.debhelper.log
debian/*.substvars
debian/files
debian/libuci-dev/
debian/libuci-plugin-lua5.1/
debian/libuci0/
debian/changelog
debian/tmp/
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,10 @@ INSTALL(TARGETS uci cli
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

ADD_CUSTOM_TARGET(debian
COMMAND ${CMAKE_COMMAND} -E echo "Generating debian/changelog from git..."
COMMAND ${CMAKE_SOURCE_DIR}/debian/generate-changelog.sh
COMMAND dpkg-buildpackage -b -uc -us
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Building Debian package"
)
45 changes: 45 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Source: uci
Section: libs
Priority: optional
Maintainer: Russ Dill <russ.dill@gmail.com>
Build-Depends: debhelper-compat (= 13),
cmake,
ninja-build,
libubox-dev (>= 2021~) | libubox-dev,
liblua5.1-dev, lua5.1
Standards-Version: 4.7.0
Homepage: https://github.com/openwrt/uci
Rules-Requires-Root: no

Package: libuci0
Section: libs
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Unified Configuration Interface (runtime library)
UCI (Unified Configuration Interface) is OpenWrt’s configuration system.
This package provides the shared library (SONAME 0).

Package: libuci-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Depends: libuci0 (= ${binary:Version}), ${misc:Depends}
Description: Unified Configuration Interface (development files)
Headers and the development symlink for libuci.

Package: uci
Section: admin
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libuci0 (= ${binary:Version})
Description: Unified Configuration Interface (command-line utility)
The uci CLI manipulates configuration stored in UCI format.

Package: libuci-plugin-lua5.1
Section: libs
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}, libuci0 (= ${binary:Version})
Description: Unified Configuration Interface (Lua module)
Lua 5.1 binding for libuci.

15 changes: 15 additions & 0 deletions debian/generate-changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

cd "$(dirname "$0")/.."

COMMIT_DATE=$(git log -1 --format='%cd' --date=format:'%Y%m%d' 2>/dev/null || echo '00000000')
COMMIT_HASH=$(git log -1 --format='%h' 2>/dev/null || echo 'unknown')
COMMIT_TIMESTAMP=$(git log -1 --format='%cd' --date=rfc2822 2>/dev/null || date -R)

cat > debian/changelog <<EOF
uci (0.0.${COMMIT_DATE}) unstable; urgency=medium

* Latest version (${COMMIT_HASH})

-- Russ Dill <russ.dill@gmail.com> ${COMMIT_TIMESTAMP}
EOF
2 changes: 2 additions & 0 deletions debian/libuci-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/include/uci*.h
usr/lib/*/libuci.so
1 change: 1 addition & 0 deletions debian/libuci-plugin-lua5.1.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/*/lua/5.1/uci.so
1 change: 1 addition & 0 deletions debian/libuci0.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/*/libuci.so.0*
19 changes: 19 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
dh $@ --buildsystem=cmake

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX=/usr \
-DABIVERSION:STRING=0.0 \
-DBUILD_LUA=ON \
-DBUILD_STATIC=OFF \
-DLUAPATH=/usr/lib/$(DEB_HOST_MULTIARCH)/lua/5.1

# Let dh_makeshlibs capture shlibs and apply the SONAME.
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
1 change: 1 addition & 0 deletions debian/uci.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/bin/uci
5 changes: 5 additions & 0 deletions debian/watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version=4
# Upstream mirrors to git.openwrt.org without formal releases; you can snapshot.
# Example (replace when tags exist):
# opts=filenamemangle=s/.+\/uci-(\d\S+)\.tar\.gz/uci-$1\.tar\.gz/ \
# https://git.openwrt.org/?p=project/uci.git;a=tags .*/v?(\d\S+