ファイル構成
$ tree gitclone_1.0-1_amd64
gitclone_1.0-1_amd64
├── DEBIAN
│ └── control
└── usr
└── local
└── bin
└── gitclone.sh
gitclone_1.0-1_amd64/DEBIAN/control
Package: gitclone
Version: 1.0-1
Section: base
Priority: optional
Architecture: amd64
Pre-Depends: git
Maintainer: ekzemplaro <you@email.com>
Description: git clone
When you need some sunshine, just run this
small program!
(the space before each line in the description is important)
gitclone_1.0-1_amd64/usr/local/bin/gitclone.sh
#! /bin/bash
#
echo '*** gitclone.sh *** start ***'
echo 'Mar/26/2021 PM 17:28'
#
cd /tmp
git clone https://github.com/ekzemplaro/storytelling
#
echo '*** gitclone.sh *** end ***'
gitclone.sh のファイル属性は 0755 です。
パッケージの作成
dpkg-deb --build gitclone_1.0-1_amd64
パッケージのインストール
sudo apt install ./gitclone_1.0-1_amd64.deb
インストールしている様子
$ sudo apt install ./gitclone_1.0-1_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gitclone' instead of './gitclone_1.0-1_amd64.deb'
The following additional packages will be installed:
git
Suggested packages:
git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk
gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
git gitclone
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/4558 kB of archives.
After this operation, 36.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 /home/ubuntu/tmp/mar27/gitclone_1.0-1_amd64.deb gitclone amd64 1.0-1 [980 B]
Selecting previously unselected package git.
(Reading database ... 101407 files and directories currently installed.)
Preparing to unpack .../git_1%3a2.25.1-1ubuntu3.1_amd64.deb ...
Unpacking git (1:2.25.1-1ubuntu3.1) ...
Setting up git (1:2.25.1-1ubuntu3.1) ...
Selecting previously unselected package gitclone.
(Reading database ... 102155 files and directories currently installed.)
Preparing to unpack .../mar27/gitclone_1.0-1_amd64.deb ...
Unpacking gitclone (1.0-1) ...
Setting up gitclone (1.0-1) ...
削除方法
sudo apt remove gitclone --purge