Build deb package
Tutorials
Create a deb package
- How to create a .deb file (tutorial)
- 如何製作「deb檔(Debian Package)」
- How to Create DEB Packages for Debian/Ubuntu
- How to Create a Simple Debian Package
- How to Create a Simple (.deb) Debian Package
- On Building a Debian Package of a Ruby Program
- Samples
Rebuild a deb package from source
Extract a DEB package
dpkg -x coin-manager.22.11.15.deb source
tree --dirsfirst --filelimit 10 --sort=name source/
source/
├── opt
│ └── coinmanager
│ └── html [133 entries exceeds filelimit, not opening dir]
└── usr
└── share
└── doc
└── coin-manager
├── changelog.Debian.gz
├── copyright
└── README.Debian
7 directories, 3 files
For control file
dpkg -e coin-manager.22.11.15.deb source/DEBIAN
tree source/DEBIAN
source/DEBIAN
├── control
└── md5sums
0 directories, 2 files
Build a DEB package
tree --dirsfirst --filelimit 10 --sort=name coin-manager/
coin-manager/
├── DEBIAN
│ ├── control
│ └── md5sums
├── opt
│ └── coinmanager
│ └── html [133 entries exceeds filelimit, not opening dir]
└── usr
└── share
├── applications
│ └── coin_manager.desktop
├── doc
│ └── coin-manager
│ ├── changelog.Debian.gz
│ ├── copyright
│ └── README.Debian
└── icons
└── hicolor
├── 128x128
│ └── apps
│ └── coin-manager.png
├── 16x16
│ └── apps
├── 22x22
│ └── apps
├── 24x24
│ └── apps
├── 32x32
│ └── apps
│ └── coin-manager.png
├── 48x48
│ └── apps
│ └── coin-manager.png
├── 64x64
│ └── apps
│ └── coin-manager.png
└── scalable
└── apps
└── coin-manager.svg
27 directories, 11 files
cat coin-manager/DEBIAN/control
Package: coin-manager
Version: 22.11.15build2
Architecture: all
Maintainer: CoinManager Dev <support@cloudcoin.global>
Installed-Size: 52224
Depends: libc6 (>= 2.14), libgcc-s1 (>= 3.0), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.12.0), libgtk-3-0 (>= 3.0.0), libjavascriptcoregtk-4.0-18, libstdc++6 (>= 5.2), libwebkit2gtk-4.0-37 (>= 2.21.1)
Section: contrib/admin
Priority: optional
Homepage: https://cloudcoinconsortium.com
Description: CloudCoin 2.0 manager
Coini-Manager is the program for managing CloudCoins 2.0
cat coin-manager/usr/share/applications/coin_manager.desktop
[Desktop Entry]
Comment=Coin Manager - CloudCoin 2.0
Terminal=false
Name=Coin-Manager
Exec=/opt/coinmanager/html/cloudcoin_manager
Type=Application
Icon=coin-manager
dpkg -b coin-manager
# Alternatively
mkdir build
dpkg -b coin-manager build
Build Appimage with deb package
Download: https://github.com/AppImageCommunity/pkg2appimage
tree
.
├── coin-manager_22.11.15build3_amd64.deb
├── coin-manager.yml
└── pkg2appimage-1807-x86_64.AppImage
0 directories, 3 files
coin-manager.yml
app: coin_manager
binpatch: true
ingredients:
dist: focal
sources:
- deb http://free.nchc.org.tw/ubuntu focal main universe
debs:
- /home/alang/worktmp/AppImage_App/Using_pkg2appimage/coin-manager_22.11.15build3_amd64.deb
script:
- VERSION="22.11.15build3"
- cp ./usr/share/applications/coin_manager.desktop .
- cp ./usr/share/icons/hicolor/256x256/apps/coin-manager.png coin_manager.png
- sed -i -e 's|Exec=.*|Exec=coin_manager|g' coin_manager.desktop
- sed -i -e 's|Icon=.*|Icon=coin_manager|g' coin_manager.desktop
- ( cd usr/bin ; ln -s ../../opt/coinmanager/html/cloudcoin_manager coin_manager )
- echo $VERSION > ../VERSION
- app: 專案名稱
- debs: 來源檔 Deb package 路徑
- VERSION: Appimage 檔案版號
- *.desktop: 需包含有
Categories
的參數 - 執行檔需在 /usr/bin/ 或 /bin 有連結,因為 *.desktop 的
Exec
不能使用絕對路徑
Build Appimage
./pkg2appimage-1807-x86_64.AppImage coin-manager.yml
tree --dirsfirst -L 3 --filelimit 10 --sort=name
.
├── coin_manager
│ ├── coin_manager.AppDir
│ │ ├── opt
│ │ ├── usr
│ │ ├── AppRun
│ │ ├── coin_manager.desktop
│ │ └── coin_manager.png
│ ├── tmp
│ │ ├── archives
│ │ ├── lists
│ │ ├── pkgcache.bin
│ │ └── srcpkgcache.bin
│ ├── cache.txt
│ ├── coin-manager_22.11.15build3_amd64.deb
│ ├── Packages.gz
│ ├── sources.list
│ ├── status
│ ├── teste_123
│ └── VERSION
├── out
│ └── Coin-Manager-22.11.15build3.glibc2.14-x86_64.AppImage
├── coin-manager_22.11.15build3_amd64.deb
├── coin-manager.yml
└── pkg2appimage-1807-x86_64.AppImage
8 directories, 16 files
No Comments