#!/bin/sh
# Copyright 2008 (c), YUNIX All rights reserved.
# Filename : FSourceTDeb.sh
# Description: Built deb package from source
# Author : John YU
# Version : 1.0
# Date : 08-12-29
#apt-get update
#dpkg -P vim-common vim-tiny
Get="apt-get -y --force-yes install "
$Get vim locales automake autoconf
$Get build-essential dh-make devscripts fakeroot
cat /etc/locale.gen | grep "zh_CN.UTF-8"
if [ $? == 1 ]; then
cat << eof >> /tmp/locale.gen
en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GB2312
zh_CN.GB18030 GB18030
zh_CN.UTF-8 UTF-8
eof
cp -av /tmp/locale.gen /etc/locale.gen
chmod 644 /etc/locale.gen
locale-gen &
fi
rm -fr `pwd`/BuiltRoot2
mkdir -p `pwd`/BuiltRoot2/mysmall-1.0
cd `pwd`/BuiltRoot2/mysmall-1.0
cat <> hellodeb.c
#include
int main(void)
{
printf("hello deb\n");
return 0;
}
eof
cat <> Makefile
PROG=hellodeb
CC=gcc
BINDIR=\$(DESTDIR)/usr/bin
INSTALL=cp
\$(PROG): hellodeb.c
\$(CC) -o \$(PROG) hellodeb.c
clean:
rm -rf \$(PROG)
install:
mkdir -p \$(BINDIR)
\$(INSTALL) \$(PROG) \$(BINDIR)
uninstall:
rm -rf \$(BINDIR)/\$(PROG)
eof
tar -czvf mygame-1.0.tar.gz hellodeb.c Makefile
dh_make -s -e debianyu@163.com -f mygame-1.0.tar.gz
rm -fr mygame-1.0.tar.gz
debuild -uc -us
pwd && ls
阅读(542) | 评论(0) | 转发(0) |