0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

コマンドを実行する Deb ファイル

Last updated at Posted at 2021-03-26

こちらのプログラムを参考にしました。
Debian Packageを作成する
ファイルを配置の前後で、コマンドを実行します。

ファイル構成

$ tree package-test
package-test
├── DEBIAN
│   ├── control
│   ├── postinst
│   └── preinst
└── usr
    └── share
        └── doc
            └── package-test
                └── aa01.txt

preinst と postinst のファイル属性は 0755 です。

package-test/DEBIAN/control
Package: package-test
Version: 1.0.1
Architecture: all
Maintainer: ekzemplaro
Section: education
Priority: extra
Description: Packaging test.
package-test/DEBIAN/preinst
#! /bin/bash

set -e
#
#        written Tue Jan 20 2015


# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

echo 'preinst' > /tmp/preinst.txt

cd /tmp
git clone https://github.com/ekzemplaro/data_base_language

echo 'preinst *** end ***' >> /tmp/preinst.txt

exit 0
package-test/DEBIAN/postinst
#! /bin/bash
# postinst.skeleton
# Skeleton maintainer script showing all the possible cases.
# Written by Charles Briscoe-Smith, March-June 1998.  Public Domain.
# Abort if any command returns an error value
#

set -e

#        written Tue Jan 20 2015

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

echo 'postinst' > /tmp/postinst.txt

cd /tmp
git clone https://github.com/ekzemplaro/storytelling

echo 'postinst *** end ***' >> /tmp/postinst.txt

exit 0
package-test/usr/share/doc/package-test/aa01.txt
Mar/26/2021 PM 18:47

パッケージの作成

dpkg-deb --build package-test

package-test.deb が作成されます。

実行

sudo dpkg -i package-test.deb

実行すると次のファイル、フォルダーが作成されます。

/usr/share/doc/package-test
/usr/share/doc/package-test/aa01.txt
/tmp/preinst.txt
/tmp/postinst.txt
/tmp/data_base_language
/tmp/storytelling

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?