Language:EN / NE / AE / DE / IT

안녕하세요. MPD 를 사용하면서 웹 UI 를 넣을까 말까 했습니다.


그런데 내장을 해야하는것이 좋았다고 생각이 들고 있습니다 ㅎㅎ...ㅠㅠ



그래서 빌드한 패키지를 공개 드립니다.





1. 패키지 만들기


checkinstall 을 이용하면 쉽게 만들 수 있습니다.


이전에는 수동 노가다로 만들었지만, 이제는 쉽게 배포가 가능합니다.


ISO / SACD MPD 도 이렇게 패키지로 제공 드리겠습니다.


root@AOL-Debian:~/ympd# ls

build  CMakeLists.txt  description-pak doc-pak  LICENSE    src    ympd.1

cmake  contrib        Dockerfile htdocs  README.md  tools

root@AOL-Debian:~/ympd# cd build/


ympd 의 경우 cmake 를 사용하기 때문에 build 경로로 이동하며 checkinstall 을 실행하셔야 합니다.


기본적으로 checkinstall 패키지가 없기 때문에 일단 apt-get install checkinstall 을 해주셔야 합니다.


root@AOL-Debian:~/ympd/build# checkinstall


checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran

           This software is released under the GNU GPL.



The package documentation directory ./doc-pak does not exist. 

Should I create a default set of package docs?  [y]: y


Preparing package documentation...OK


*** No known documentation files were found. The new package 

*** won't include a documentation directory.


Please write a description for the package.

End your description with an empty line or EOF.

>> ympd by djjproject

>> 


*****************************************

**** Debian package creation selected ***

*****************************************


This package will be built according to these values: 


0 -  Maintainer: [ root@AOL-Debian ]

1 -  Summary: [ ympd by djjproject ]

2 -  Name:    [ build ]

3 -  Version: [ 20180926 ]

4 -  Release: [ 1 ]

5 -  License: [ GPL ]

6 -  Group:   [ checkinstall ]

7 -  Architecture: [ armhf ]

8 -  Source location: [ build ]

9 -  Alternate source location: [  ]

10 - Requires: [  ]

11 - Provides: [ build ]

12 - Conflicts: [  ]

13 - Replaces: [  ]


Enter a number to change any of them or press ENTER to continue: 0

Enter the maintainer's name and e-mail address: 

>> djjproject


This package will be built according to these values: 


0 -  Maintainer: [ djjproject ]

1 -  Summary: [ ympd by djjproject ]

2 -  Name:    [ build ]

3 -  Version: [ 20180926 ]

4 -  Release: [ 1 ]

5 -  License: [ GPL ]

6 -  Group:   [ checkinstall ]

7 -  Architecture: [ armhf ]

8 -  Source location: [ build ]

9 -  Alternate source location: [  ]

10 - Requires: [  ]

11 - Provides: [ build ]

12 - Conflicts: [  ]

13 - Replaces: [  ]


Enter a number to change any of them or press ENTER to continue: 


Installing with make install...


========================= Installation results ===========================

[ 12%] Built target mkdata

[100%] Built target ympd

Install the project...

-- Install configuration: ""

-- Up-to-date: /usr/bin/ympd

-- Up-to-date: /usr/share/man/man1/ympd.1


======================== Installation successful ==========================


Copying files to the temporary directory...OK


Stripping ELF binaries and libraries...OK


Compressing man pages...OK


Building file list...OK


Building Debian package...OK


Installing Debian package...OK


Erasing temporary files...OK


Writing backup package...OK

OK


Deleting temp dir...OK



**********************************************************************


 Done. The new package has been installed and saved to


 /root/ympd/build/build_20180926-1_armhf.deb


 You can remove it from your system anytime using: 


      dpkg -r build


**********************************************************************


root@AOL-Debian:~/ympd/build# ls

assets.c    CMakeCache.txt config.h       Makefile

backup-092620180311-pre-build.tgz  CMakeFiles description-pak       mkdata

build_20180926-1_armhf.deb    cmake_install.cmake install_manifest.txt  ympd


만들어진 패키지를 살짝 수정합니다.


init.d 스크립트를 추가해 주어야합니다.


# 자동 빌드된 deb 파일 풀기

# 원스텝 : 컨트롤 파일 풀어내기

# 투스텝 : 설치 파일들 꺼내기

root@AOL-Debian:~# dpkg -x build_20180926-1_armhf.deb

root@AOL-Debian:~# mkdir ympd-dinobot-u5

root@AOL-Debian:~# dpkg -x build_20180926-1_armhf.deb ympd-dinobot-u5/



# 원스텝시 경로를 지정하지 않아서 DEBIAN 폴더를 작업 경로로 옮깁니다.

root@AOL-Debian:~# ls

build_20180926-1_armhf.deb  Python-3.6.3  upmpdcli      ympd-dinobot-u5

DEBIAN     Python-3.6.3.tgz  upmpdcli_0.4-1_armhf.build

nohup.out     supersu-install.deb  ympd



root@AOL-Debian:~# mv DEBIAN/ ympd-dinobot-u5/

root@AOL-Debian:~# ls

build_20180926-1_armhf.deb  Python-3.6.3.tgz  upmpdcli_0.4-1_armhf.build

nohup.out     supersu-install.deb  ympd

Python-3.6.3     upmpdcli  ympd-dinobot-u5

root@AOL-Debian:~# cd ympd-dinobot-u5/



# 원스텝 / 투스텝 후의 모습입니다.

root@AOL-Debian:~/ympd-dinobot-u5# ls

DEBIAN usr


# 현재 사용하는 스크립트 (만들어둔..) 를 넣어주기 위해서 폴더를 생성합니다.

# 실행권한 줍니다.

root@AOL-Debian:~/ympd-dinobot-u5# mkdir -p etc/init.d

root@AOL-Debian:~/ympd-dinobot-u5# cd etc/init.d/

root@AOL-Debian:~/ympd-dinobot-u5/etc/init.d# cp /etc/init.d/ympd .

root@AOL-Debian:~/ympd-dinobot-u5/etc/init.d# chmod a+x ympd 



root@AOL-Debian:~/ympd-dinobot-u5/etc/init.d# cd ..

root@AOL-Debian:~/ympd-dinobot-u5/etc# cd ..

root@AOL-Debian:~/ympd-dinobot-u5# cd DEBIAN/


# 컨트롤 파일, postinst 를 추가합니다.

root@AOL-Debian:~/ympd-dinobot-u5/DEBIAN# ls

conffiles  control

root@AOL-Debian:~/ympd-dinobot-u5/DEBIAN# nano postinst


#!/bin/bash

chmod a+x /etc/init.d/ympd

update-rc.d ympd defaults

update-rc.d ympd enable

echo "Installation Finished..."

service ympd start

# 혹시 모를 실행권한 한번 더 주기

# 기본 서비스로 등록

# 서비스 시작



# postinst 에 실행권한 주기

root@AOL-Debian:~/ympd-dinobot-u5/DEBIAN# chmod a+x postinst 

root@AOL-Debian:~/ympd-dinobot-u5/DEBIAN# cd ~



# 패키지 리빌딩

root@AOL-Debian:~# dpkg -b ympd-dinobot-u5/

dpkg-deb: building package `build' in `ympd-dinobot-u5.deb'.


번외편으로 u5pvr.djjproject.com 으로 파일 전송입니다.


scp -P 포트 전송파일 경로 이런식으로 입력합니다.


root@AOL-Debian:~# scp -P 23441 ympd-dinobot-u5.deb root@djjproject.com:/media/volume1/htdocs/u5pvr

root@djjproject.com's password: 

ympd-dinobot-u5.deb                                                  100%  281KB 281.2KB/s   00:00    





2. 패키지 받아 설치하기


wget 으로 파일 받고 설치 하시면 끝납니다.


root@AOL-Debian:~# wget http://u5pvr.djjproject.com/ympd-dinobot-u5.deb

--2018-09-26 03:16:28--  http://u5pvr.djjproject.com/ympd-dinobot-u5.deb

Resolving u5pvr.djjproject.com (u5pvr.djjproject.com)... 58.123.71.137

Connecting to u5pvr.djjproject.com (u5pvr.djjproject.com)|58.123.71.137|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 287926 (281K) [application/x-debian-package]

Saving to: ‘ympd-dinobot-u5.deb’


ympd-dinobot-u5.deb       100%[======================================>] 281.18K   813KB/s   in 0.3s   


2018-09-26 03:16:29 (813 KB/s) - ‘ympd-dinobot-u5.deb’ saved [287926/287926]


root@AOL-Debian:~# dpkg -i ympd-dinobot-u5.deb 

Selecting previously unselected package build.

(Reading database ... 25019 files and directories currently installed.)

Preparing to unpack ympd-dinobot-u5.deb ...

Unpacking build (20180926-1) ...

Setting up build (20180926-1) ...

Installation Finished...

Processing triggers for man-db (2.7.0.2-5) ...

Processing triggers for systemd (215-17+deb8u6) ...

root@AOL-Debian:~# service ympd start

[ ok ] Starting ympd Daemon: ympd.

root@AOL-Debian:~#


U5 아이피로 접근해 보시면 아래의 UI 가 반길 것입니다.


http://u5_ipaddr:7700




차후에는 apt repository 를 구축하여, U5 리눅스 펌웨어 업그레이드를 증분으로 작업해 보겠습니다.


전에 살짝 작업해 본 경험이 있습니다. U5 에 설치 과정을 간편화 하기 위해 따로 운영을 해봐야겠다고 생각은 하고 있습니다.


감사합니다.