次のファイルがある大規模なプロジェクトがあります。
- いくつかのサードパーティのプリコンパイル済みバイナリ
- 独自の社内バイナリ
- Ruby スクリプト集
- かなりの規模の Ruby on Rails プロジェクト
この製品は、ターゲット OS として Ubuntu Linux (Lucid) を使用して、雇用主が既に選択したアプライアンス ハードウェアにインストールされます。目標は、インストールとアップグレードを容易にするために、アーカイブを Debian パッケージとして配布することです。さらに、顧客ごとに適切な値を「入力」する必要がある多くの ERB テンプレートがあるため、postinstスクリプトの使用は、この目的には特に便利です。
ちなみに、Debian パッケージは、社内で管理するサーバー リポジトリに保存されます。
この段階で、dh_makeを使用して Debian ディレクトリと関連ファイル (例: rules、control など) を作成しましたが、生成された rules ファイルは私の目的にはやり過ぎのようです。
この説明に基づいて、「ルール」ファイルで本当に必要なのは、ソース ディレクトリ (またはアーカイブ内) から以下に示すターゲット ディレクトリにファイルをコピーすることだけです。
/opt/company_product/3rd_party_binaries/bin
/opt/company_product/3rd_party_binaries/etc
/opt/company_product/in_hourse_binaries/bin
/opt/company_product/in_hourse_binaries/etc
/opt/company_product/ruby
/opt/company_product/rails_project
/opt/company_product/etc
/opt/company_product/shared/logs
/opt/company_product/shared/tmp
/opt/company_product/shared/license
...等々。
私は Debian Policy Manual といくつかの How-To を読みましたが、ディレクトリの作成に使用する rules ファイルを変更してはならないことを示しており、通常、ほとんどのニーズを満たすことができるdh_アプリ (dh_installdirs など) があります。インストールの目的。これらのdh_関連アプリのマニュアル ページはせいぜい大雑把で、私は「例」のような人です。mkdir
とは言うものの、ルールファイルを取得して、コンパイル済みのさまざまなバイナリと Ruby/Rails テキスト ファイルを目的の場所にインストールするための最善の方法について、少し迷っています。
これが私の最初のルールファイルです。これは、dh_make が作成するほぼ標準的なボイラープレート ルール ファイルです。私の考えでは、インストール以外のすべてのセクションをコメントアウトし、そのセクション内でディレクトリを作成したり、ファイルをコピーしたりするための適切なコマンドを見つける必要があります。
アドバイスや提案は大歓迎です。
#!/usr/bin/make -f
package = testapp
CC = gcc
CFLAGS = -g -Wall
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O2
endif
#export DH_VERBOSE=1
clean:
dh_testdir
dh_clean
rm -f build
install: build
dh_clean
dh_installdirs
echo "Place the Install Script here"
cp $(CURDIR)/testapp-2.0.tar.gz $(CURDIR)/debian/$(package)/opt/testapp-2.0
echo "Finished copying folders"
build:
touch build
binary-indep: install
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: install
dh_testdir -a
dh_testroot -a
dh_installdocs -a
dh_installchangelogs -a
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean checkroot