Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!

Ogłoszenie

Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

#1  2010-06-04 18:34:49

  Akkon - Użytkownik

Akkon
Użytkownik
Zarejestrowany: 2009-04-18

Budowa paczki deb z przygotowanych wcześniej źródeł

Posiadam program, który jest już jak rozumiem skompilowany i gotowy do instalacji przy pomocy skryptu Install.sh. Jego struktura to:

Kod:

bashburn_man/
burning/
config/
convert/
deb/
docs/
func/
lang/
menus/
misc/
rpm/
BashBurn.sh
Install.sh
Makefile

Chciałbym z niego zbudować paczkę. Autor wszystko przygotował i zamieścił nawet instrukcję:

Copy (Not link) all files that should go into /usr/lib/BashBurn/lib
  into the directory debian/usr/lib/BashBurn/lib
* In the debian/usr/bin directory, create a symlink to BashBurn.sh in
  the lib directory called bashburn.
  That is, in debian/usr/bin run:
  'ln -s ../lib/BashBurn/lib/BashBurn.sh bashburn'
* Run 'dpkg-deb --build debian' to create the deb package.[/quote]
Wszystko ładnie pięknie opisane, tylko jest jeden szkopuł dla kompilacyjnego lamera

Copy all files that should go ...[/quote]
No właśnie, jakie to pliki/katalogi powinny trafić do tego folderu, bo chyba przecież nie cała struktura?

Offline

 

#2  2010-06-04 18:50:32

  azhag - Admin łajza

azhag
Admin łajza
Skąd: Warszawa
Zarejestrowany: 2005-11-15

Re: Budowa paczki deb z przygotowanych wcześniej źródeł

Pokaż Install.sh


Błogosławieni, którzy czynią FAQ.
[url=http://www.opencaching.pl]opencaching[/url] :: [url=http://dug.net.pl/sources.list]debian sources.list[/url] :: [url=http://www.linuxportal.pl/blogi/azhag/wpisy]coś jakby blog[/url] :: [url=http://dug.net.pl/]polski portal debiana[/url] :: linux user #403712

Offline

 

#3  2010-06-04 20:09:50

  Akkon - Użytkownik

Akkon
Użytkownik
Zarejestrowany: 2009-04-18

Re: Budowa paczki deb z przygotowanych wcześniej źródeł

#!/bin/bash

errmsg()
{
    echo "$prog:$@" 1>&2
}
die()
{
    errmsg "$@"
    exit 1
}

proc_opts()
{
    typeset temp
    typeset arg

    temp=$(getopt -o :P:UHm --long prefix:,uninstall,help,make-tar -n $prog — "$@")
    (( $? )) && usage && die 'getopt failure'

    # Note the quotes around `$temp': they are essential!
    eval set — "$temp"
    while true
    do
        case "$1" in
    -P|--prefix)
        [[ -z "$potprefix" ]] || usage 'You already specified --destdir'
        potprefix="$2"    # POTential PREFIX
        shift 2
        ;;
    -U|--uninstall)
        (( unistall )) && usage 'You said --uninstall twice?'
        uninstall=1
        shift
        ;;
    -H|--help)
        help=1
        shift
        ;;
    -m|--make-tar)
        (( maketar )) && usage 'You said --make-tar twice?'
        maketar=1
        shift
        ;;
    --)
        shift
        break
        ;;
    *)
        usage "$1: Unknown option"
        ;;
        esac
    done
    (( $# > 0 )) && die "Too many arguments: $@"
} # proc_opts

usage()
{
    errmsg "$@"
    cat <<EOF 1>&2
Usage:
    $0 [OPTIONS]

    -P dir, --prefix=dir
    -U, --uninstall
    -H, --help
    -m, --make-tar

--prefix= will allow the user to specify the prefix directory
where BashBurn will be installed or uninstalled.
The default is $defprefix. The support files will go
into \$dir/lib/BashBurn/lib and the program(s) will be in \$dir/bin

--uninstall will remove all of the BashBurn files from your system
based on its knowledge of what prefix is.

--make-tar will create a .tar.bz2 file suitable for use in creating an RPM.
           Must be used with --prefix.

--help This message

EOF
    exit 1
}

installation_finish()
{
    uninstall_info
    printf "\nInstallation finished successfully.
Now start %bBashBurn%b with the command %bbashburn%b, and
remember to configure it before trying to use it.\n\n" \
    "${green}" "${coloff}" "${blue}" "${coloff}"
}

install_files()
{
    typeset ii
    typeset jj
    typeset kk
    typeset -a dir_list=( \
        burning \
        config \
        convert \
        docs \
        func \
        lang \
        menus \
        misc \
        )
    typeset -ra docs_files=( \
        ChangeLog \
        COPYING \
        CREDITS \
        FAQ \
        HOWTO \
        README \
        TODO \
        TRANSLATION_RULE \
        )
    typeset -ra top_files=( \
        BashBurn.sh \
        )
    typeset -ra burning_files=( \
        bincue.sh \
        burning.sh \
        multi.sh \
        )
    typeset -ra config_files=( \
        apply_options.sh \
        )
    typeset -ra convert_files=( \
        convert_audio.sh \
        convert_flacs.sh \
        convert_mp3s.sh \
        convert_oggs.sh \
        )
    typeset -ra func_files=( \
        advancedfunc.sh \
        audiofunc.sh \
        bincuefunc.sh \
        configfunc.sh \
        datafunc.sh \
        definefunc.sh \
        isofunc.sh \
        mountfunc.sh \
        multifunc.sh \
        )
    typeset -ra languages=( \
        Czech \
        English \
        German \
        Italian \
        Norwegian \
        Polish \
        Spanish \
        Swedish \
        )
    typeset -ra lang_files=( \
        BashBurn.lang \
        README \
        advanced.lang \
        audio_menu.lang \
        bincue.lang \
        burning.lang \
        check_path.lang \
        commonfunctions.lang \
        configure.lang \
        convert_flacs.lang \
        convert_mp3s.lang \
        convert_oggs.lang \
        data_menu.lang \
        datadefine.lang \
        iso_menu.lang \
        loopback.lang \
        mount.lang \
        multi.lang \
        )
    typeset -ra menus_files=( \
        advanced.sh \
        audio_menu.sh \
        bbmenu.sh
        configure.sh \
        datadefine.sh \
        data_menu.sh \
        iso_menu.sh \
        mount.sh \
        )
    typeset -ra misc_files=( \
        check_path.sh \
        colors.idx \
        commands.idx \
        commonfunctions.sh \
        loopback.sh \
        m3u_read.sh \
        configure_temp_help.lang \  # This needs to go after all BBLANG help
                    # texts are completed/updated
        )
    echo -e "\nInstalling files... "
    mkdir -p $bblib || die 'Error: Can not create lib directory.'
    for ii in "${dir_list[@]}"
    do
    mkdir -p $bblib/$ii ||
        die 'Error: Can not create a subdirectory in lib.'
    if [[ $ii == lang ]]
    then
        for jj in "${languages[@]}"
        do
        mkdir -p $bblib/$ii/$jj ||
            die 'Error: Can not create a lang directory.'
        for kk in $(eval echo "\${${ii}_files[@]}")
        do
            cp "lang/${jj}/$kk" $bblib/$ii/$jj/ ||
            die "Failed to copy $ii/$jj/$kk" ||
            die 'Error: Failed to copy a file to a lang dir.'
        done
        done
    else
        for kk in $(eval echo "\${${ii}_files[@]}")
        do
        cp $ii/$kk $bblib/$ii/ || die "Failed to copy $ii/$kk"
        done
    fi
    done
    for ii in "${top_files[@]}"
    do
    cp $ii $bblib/$ii || die "Failed to copy $ii"
    done
    # After installing, See what tickles are needed.
    make -C bashburn_man
    mkdir -p $prefix/share/man/man1
    gzip < bashburn_man/bashburn.1 > $prefix/share/man/man1/bashburn.1.gz
    if (( ! maketar ))
    then
    cd $bblib
    sed -e "s%@@BBROOTDIR@@%$bblib%" BashBurn.sh > newbb-$$.sh
    mv newbb-$$.sh BashBurn.sh
    chmod +x BashBurn.sh
    echo -e "${green}[DONE]${coloff}"

    echo -n "Creating symlink... "
    mkdir -p $bin || die 'Error could not create the bin directory.'
    ln -sf $bblib/BashBurn.sh $bin/bashburn || die "Can not create symlink"
    echo -e "${green}[DONE]${coloff}"

    echo -en "Setting ownership..."
    (( $(id -u) == 0 )) && chown -R root:root $bblib
    echo -e "${green}[DONE]${coloff}"
    installation_finish
    fi
}

uninstall_info()
{
    printf "\nTo remove %bBashBurn%b from your system, just run
%bInstall.sh --uninstall%b
to delete these files:
%b%s%b  (symlink)\n%b%s%b  (directory).\n" \
    "${green}" "${coloff}" "$blue" "$coloff" "$blue" "$bin/bashburn" "$coloff" "$blue" "$lib" "$coloff"
}

uninstall_files()
{
    printf "\nRemoving %bBashBurn%b from your system..." "$blue" "$coloff"
    rm -rf $bin/bashburn $bblib $prefix/share/man/man1/bashburn.1.gz
    echo -e "${green}[DONE]${coloff}\n\n"
}

intro_banner()
{
   printf "%b
   (             )  (                 
( )\    )    ( /(( )\   (  (         
)((_)( /( (  )\())((_) ))\ )(   (     
((_)_ )(_)))\((_)((_)_ /((_)()\  )\ ) 
%b | _%b )(_)_((_)%b |(_) _%b )_))( ((_)_(_/( 
%b | _ \ _\` (_-< ' \| _ \ || | '_| ' \%b))%b
|___\__,_/__/_||_|___/\_,_|_| |_||_| 
                                       
%b" "$yellow" "$red" "$yellow" "$red" "$yellow" "$red" "$yellow" "$red" "$coloff"
}

# Keep in spectrum order
typeset -r red="\e[1;31m"
typeset -r yellow="\e[1;33m"
typeset -r green="\e[1;32m"
typeset -r blue="\e[1;36m"
typeset -r coloff="\e[1;0m"    # Color off.

prog=$0
typeset -i uninstall=0
typeset -i help=0
typeset -i maketar=0
typeset -r defprefix=/usr

proc_opts "$@"
(( maketar && uninstall )) && usage '--make-tar is incompatible with --uninstall'
if (( maketar )) && [[ -z "$potprefix" ]]
then
    usage '--make-tar requires --prefix'
fi
(( help )) && usage
if (( uninstall ))
then
    echo -e "\nUninstall script for:"
else
    echo -e "\nInstallation script for:"
fi
intro_banner
sleep 2
prefix=${potprefix:=${defprefix}}
[[ "${prefix:${#foo}-1:1}" == / ]] && prefix="${prefix:0:${#prefix}-1}"
printf "Directory prefix has been set to $blue $prefix $coloff\n"
bin=${prefix}/bin
lib=${prefix}/lib/Bashburn
bblib=${lib}/lib
bbpo=${lib}/po
if (( uninstall ))
then
    uninstall_files
else
    install_files
fi
exit 0[/quote]

Offline

 

#4  2010-06-04 20:31:15

  azhag - Admin łajza

azhag
Admin łajza
Skąd: Warszawa
Zarejestrowany: 2005-11-15

Re: Budowa paczki deb z przygotowanych wcześniej źródeł

Z niego niczego się nie dowiedziałem, ale przeanalizowawszy archiwum stwierdzam jak następuje:
1. Chodzi o wszystkie pliki i katalogi za wyjątkiem: bashburn_man/, deb/, Install.sh, Makefile, rpm/.
2. Ten tworzony pakiet to się nadaje...


Błogosławieni, którzy czynią FAQ.
[url=http://www.opencaching.pl]opencaching[/url] :: [url=http://dug.net.pl/sources.list]debian sources.list[/url] :: [url=http://www.linuxportal.pl/blogi/azhag/wpisy]coś jakby blog[/url] :: [url=http://dug.net.pl/]polski portal debiana[/url] :: linux user #403712

Offline

 

#5  2010-06-04 20:39:01

  Akkon - Użytkownik

Akkon
Użytkownik
Zarejestrowany: 2009-04-18

Re: Budowa paczki deb z przygotowanych wcześniej źródeł

Ten tworzony pakiet to się nadaje...[/quote]
Czemu?

Offline

 

#6  2010-06-04 20:50:35

  azhag - Admin łajza

azhag
Admin łajza
Skąd: Warszawa
Zarejestrowany: 2005-11-15

Re: Budowa paczki deb z przygotowanych wcześniej źródeł

[quote=Akkon]

Ten tworzony pakiet to się nadaje...[/quote]
Czemu?[/quote]
Zbuduj i przejedź go lintianem. ;)

No i oczywiście masz świadomość, że jest budowany pod Ubuntu (wymaga [tt]bash (>= 3.0-[b]4ubuntu1[/b])[/tt], etc.)?


Błogosławieni, którzy czynią FAQ.
[url=http://www.opencaching.pl]opencaching[/url] :: [url=http://dug.net.pl/sources.list]debian sources.list[/url] :: [url=http://www.linuxportal.pl/blogi/azhag/wpisy]coś jakby blog[/url] :: [url=http://dug.net.pl/]polski portal debiana[/url] :: linux user #403712

Offline

 

#7  2010-06-04 21:13:38

  Akkon - Użytkownik

Akkon
Użytkownik
Zarejestrowany: 2009-04-18

Re: Budowa paczki deb z przygotowanych wcześniej źródeł

Zbuduj i przejedź go lintianem. ;)[/quote]
Niestety nic mi to nie mówi.

No i oczywiście masz świadomość, że jest budowany pod Ubuntu (wymaga bash (>= 3.0-4ubuntu1), etc.)[/quote]
Świadomość mam, zależności wymagane przez program mam spełnione, rozumiem jednak, że chodzi o zależności związane z samym procesem budowania (w Ubuntu paczki buduje się inaczej?)? Reasumując, sugerujesz, że nie warto się w to bawić?

Ostatnio edytowany przez Akkon (2010-06-24 18:24:30)

Offline

 

#8  2010-06-04 21:25:48

  azhag - Admin łajza

azhag
Admin łajza
Skąd: Warszawa
Zarejestrowany: 2005-11-15

Re: Budowa paczki deb z przygotowanych wcześniej źródeł

[url=http://lintian.debian.org/]Lintian[/url] to narzędzie do sprawdzania poprawności budowanych pakietów. Użycie: [tt]lintian pakiet.deb[/tt].

Jeżeli program jest warty (czemu nie [deb]mybashburn[/deb]?) i pakiet działa — pewnie warto. Aczkolwiek nie mogę nie zauważyć, że pakiet jest daleki od poprawności.


Błogosławieni, którzy czynią FAQ.
[url=http://www.opencaching.pl]opencaching[/url] :: [url=http://dug.net.pl/sources.list]debian sources.list[/url] :: [url=http://www.linuxportal.pl/blogi/azhag/wpisy]coś jakby blog[/url] :: [url=http://dug.net.pl/]polski portal debiana[/url] :: linux user #403712

Offline

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
Nas ludzie lubią po prostu, a nie klikając w przyciski ;-)

[ Generated in 0.011 seconds, 11 queries executed ]

Informacje debugowania

Time (s) Query
0.00012 SET CHARSET latin2
0.00004 SET NAMES latin2
0.00197 SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='3.145.119.222' WHERE u.id=1
0.00097 UPDATE punbb_online SET logged=1716084287 WHERE ident='3.145.119.222'
0.00059 SELECT * FROM punbb_online WHERE logged<1716083987
0.00040 SELECT topic_id FROM punbb_posts WHERE id=149323
0.00147 SELECT id FROM punbb_posts WHERE topic_id=16998 ORDER BY posted
0.00064 SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=16998 AND t.moved_to IS NULL
0.00023 SELECT search_for, replace_with FROM punbb_censoring
0.00092 SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=16998 ORDER BY p.id LIMIT 0,25
0.00096 UPDATE punbb_topics SET num_views=num_views+1 WHERE id=16998
Total query time: 0.00831 s