From 8e6dafee839c7114f1621502474b520f54329702 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Tue, 23 May 2017 16:21:35 +0200 Subject: [PATCH] Make deb --- build_orig.sh | 86 +++++++++++++++++++++++++++ debian/README.source | 11 ++++ debian/changelog | 7 +++ debian/compat | 1 + debian/control | 16 +++++ debian/copyright | 126 ++++++++++++++++++++++++++++++++++++++++ debian/dirs | 2 + debian/docs | 1 + debian/magician.wrapper | 4 ++ debian/postinst | 14 +++++ debian/prerm | 14 +++++ debian/rules | 52 +++++++++++++++++ files.diz | 4 ++ 13 files changed, 338 insertions(+) create mode 100644 build_orig.sh create mode 100644 debian/README.source create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/docs create mode 100644 debian/magician.wrapper create mode 100644 debian/postinst create mode 100644 debian/prerm create mode 100755 debian/rules create mode 100644 files.diz diff --git a/build_orig.sh b/build_orig.sh new file mode 100644 index 0000000..26e2799 --- /dev/null +++ b/build_orig.sh @@ -0,0 +1,86 @@ +#!/bin/bash +# the directory of the script +DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd` +echo "Working directory $DIR" + +# the temp directory used, within $DIR +WORK_DIR=`mktemp -d -p "$DIR"` +echo "Creating temp working directory $WORK_DIR" + +# deletes the temp directory +function cleanup { + rm -rf "$WORK_DIR" + echo "Deleted temp working directory $WORK_DIR" +} + +# register the cleanup function to be called on the EXIT signal +trap cleanup EXIT + +# Download Files specified in files.diz +while IFS=! read type app version outputfile url md5 realver +do + echo "Downloading $app Version: $version" + #use -O for output file. define $outputfile yourself + wget -c --no-check-certificate --tries=1 -O $DIR/../$outputfile --timeout=5 "$url" + # use $(..) instead of backticks. + calculated_md5=$(md5sum "$DIR/../$outputfile" | cut -f 1 -d " ") + # compare md5 + case "$calculated_md5" in + "$md5" ) + echo "$DIR/../$outputfile md5 ok" + ;; + *) + echo "$DIR/../$outputfile md5 NOT ok" + exit 1 + ;; + esac +done < "$DIR/files.diz" + +# Extract to specified dir and set some variables +while IFS=! read type app version outputfile url md5 realver +do + mkdir -p $WORK_DIR/${type}/${realver} + pushd $WORK_DIR/${type}/${realver} + tar -zxf $DIR/../$outputfile + unzip $DIR/../$outputfile + popd + mkdir -p $WORK_DIR/${app}-${version}/${type}/${realver} + pushd $WORK_DIR/${app}-${version}/${type}/${realver} + case "${type}" in + "amd64" ) + mv $WORK_DIR/${type}/${realver}/*/64bin/magician . + mv $WORK_DIR/${type}/${realver}/magician . + chmod +x magician + ;; + "i386" ) + mv $WORK_DIR/${type}/${realver}/*/32bin/magician . + mv $WORK_DIR/${type}/${realver}/magician . + chmod +x magician + ;; + *) + echo "Wrong arch" + exit 1 + ;; + esac + echo "${app}_${version}.orig.tar.gz" > $WORK_DIR/filename.txt + echo "${app}-${version}" > $WORK_DIR/dirname.txt + echo "${version}" > $WORK_DIR/version.txt + popd +done < "$DIR/files.diz" + +FILENAME=`cat $WORK_DIR/filename.txt` +DIRNAME=`cat $WORK_DIR/dirname.txt` +echo "Creating $DIR/../$FILENAME " + +pushd $WORK_DIR +tar -czf $DIR/../$FILENAME $DIRNAME +popd + +VER=`cat $WORK_DIR/version.txt` +echo "Importing $DIR/../$FILENAME as $VER into git" +#exit 1 + +cleanup +gbp import-orig --pristine-tar -u $VER $DIR/../$FILENAME + +exit 0 diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..5db199a --- /dev/null +++ b/debian/README.source @@ -0,0 +1,11 @@ +magician-2.0.0 (1:2.0.0-1.1) unstable; urgency=low + + Sources have been repacked from the following upstream archive: + + see files.diz + + Upstream licence has been reformated using the following command: + + magician -license + + -- Mario Fetka (geos_one) Thu May 23 16:20:12 GMT 2017 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..8914343 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,7 @@ +magician (2.0.0-1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * new integrated version + + -- Mario Fetka Tue, 25 Apr 2017 04:03:29 +0200 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..167c6ed --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: magician +Section: admin +Priority: optional +Maintainer: Mario Fekta (geos_one) +Build-Depends: debhelper (>= 5) +Standards-Version: 3.9.3 + +Package: magician +Architecture: amd64 i386 +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: The Magician SSD management utility 1.0 is designed + to work with all Samsung SSD products including 470 Series, + 750 Series, 830 Series, 840 Series, 850 Series, 950 Series + and 960 Series. + The Data Center Magician SSD management utility 2.0 is designed + to work with the Samsung PM863 and SM863 Series only. \ No newline at end of file diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..89a7cbe --- /dev/null +++ b/debian/copyright @@ -0,0 +1,126 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: magician +Source: http://www.samsung.com/semiconductor/minisite/ssd/downloads/software/Samsung_Magician_DC_Linux_64bit.zip +Source: http://www.samsung.com/semiconductor/minisite/ssd/downloads/software/Samsung_Magician_DC_Linux_32bit.zip +Source: http://www.samsung.com/semiconductor/minisite/ssd/downloads/software/samsung_magician_dc-v1.0_rtm_p2.tar.gz + +Files: debian/* +Copyright: Copyright (C) 2016 Mario Fetka (geos_one) +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + +Files: * +================================================================================================ +Samsung(R) SSD Magician DC Version 1.0/2.0 +Copyright (c) 2014 Samsung Corporation +================================================================================================ + +----------------------------------------------------------------------------------------------- +| PLEASE CAREFULLY READ THE FOLLOWING TERMS AND CONDITIONS BEFORE USING THE | +| SAMSUNG MAGICIAN ('SOFTWARE') PROVIDED BY SAMSUNG ELECTRONICS CO., LTD. ('SAMSUNG'). | +| IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF | +| THIS SAMSUNG MAGICIAN SOFTWARE LICENSE AGREEMENT ('AGREEMENT'), DO NOT USE THE SOFTWARE. | +| | +| 1. LIMITED LICENSE: | +| ------------------- | +| 1.1 Samsung grants to you a nonexclusive, nontransferable and royalty-free license to use | +| the Software only with Samsung SSD (Solid State Drive) products. You may not modify the | +| Software; reverse compile, reverse engineer, disassemble or reverse assemble all or any | +| portion of the Software; rent, lease, license, sublicense, distribute, transfer or sell | +| the Software; or create derivative works of the Software. | +| 1.2 The Software contains software that is licensed under BSD 2.0 or is in the | +| public domain. | +|-----------------------------| | +| Component | License | | +|-----------------------------| | +| hdparm BSD | 2.0 | | +| Json-cpp | public domain | | +|-----------------------------| | +| - Below is the full license statement from hdparm. | +| * BSD-Style Open Source License : You may freely use, modify, and redistribute the hdparm | +| program, as either binary or source, or both. The only condition is that the name and | +| copyright notice remain in the source code as-is. Mark Lord (mlord@pobox.com) | +| - Below is the full license statement from json-cpp. | +| * The json-cpp library and this documentation are in public domain. | +| | +| 2. OWNERSHIP: | +| ------------- | +| Except as expressly licensed above, no title, ownership, or intellectual property rights of| +| any kind, express or implied, are transferred to you, and all right, title, and interest in| +| and to the Software remains with Samsung. The Software is licensed to you and not sold. | +| You must reproduce and include all copyright notices and any other proprietary rights | +| notices appearing on the Software. | +| | +| 3. NO SUPPORT: | +| -------------- | +| Samsung is under no obligation to update, maintain, or provide new versions or other | +| support for the Software. Samsung may make changes to the Software at any time without | +| notice to you. | +| | +| 4. NO WARRANTY: | +| --------------- | +| The Software is provided "AS IS" without warranty of any kind. | +| SAMSUNG EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | +| TO, NONINFRINGEMENT OF THIRD PARTY RIGHTS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR | +| FITNESS FOR ANY PARTICULAR PURPOSE, AND ANY WARRANTIES ARISING FOR ANY COURSE OF DEALING OR| +| USAGE OF TRADE. SAMSUNG DOES NOT WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS, OR | +| THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE. FURTHERMORE, | +| SAMSUNG DOES NOT MAKE ANY REPRESENTATIONS REGARDING THE USE OR | +| THE RESULTS OF THE USE OF THE SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY, | +| OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR | +| PERFORMANCE OF THE SOFTWARE REMAINS WITH YOU. | +| | +| 5. NO LIABILITY: | +| ---------------- | +| IN NO EVENT SHALL SAMSUNG OR ITS AFFILIATED COMPANIES BE LIABLE FOR ANY DIRECT, INDIRECT, | +| CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR | +| LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF YOUR USE OF | +| OR INABILITY TO USE THE SOFTWARE, EVEN IF SAMSUNG HAS BEEN ADVISED OF | +| THE POSSIBILITY OF SUCH DAMAGES. | +| | +| 6. TERMINATION: | +| --------------- | +| This Agreement is effective until terminated. This Agreement may be terminated by you at | +| any time by deleting the Software and discontinuing its use, or by Samsung if you fail to | +| cure any breach of this Agreement within sixty (60) days' written notice of breach by | +| Samsung. Upon termination, the licenses granted to you shall terminate, and you shall cease| +| all use and distribution of, and cease exercising any and all other rights granted under | +| this Agreement with respect to, the Software. | +| | +| 7. GENERAL: | +| ----------- | +| This Agreement constitutes the entire agreement between Samsung and you regarding the | +| subject matter hereof and supersedes all previous oral or written communications between | +| the parties. | +| | +| 8. DISPUTE RESOLUTION: | +| ---------------------- | +| This Agreement shall be governed by and construed in accordance with the laws of the | +| Republic of Korea, without regard to conflicts of laws principles. All disputes, | +| controversies or claims between the parties arising out of or in connection with this | +| Agreement (including its existence, validity or termination) which cannot be amicably | +| settled shall be finally resolved by arbitration to be held in Seoul, Korea in accordance | +| with the Arbitration Rules of the Korean Commercial Arbitration Board by one or more | +| arbitrators. The arbitral award shall be final and binding on the parties. | +| | +| 9. DISCLAIMER: | +| -------------- | +| Samsung is not responsible for any loss or damage to your computer, system, or application | +| programs, arising from the use of this application. Samsung also does not take any | +| liability for any kind of data loss and restoration that may occur during the installation | +| or execution of this Software.User of this application has to take complete responsibility.| +----------------------------------------------------------------------------------------------- diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..7614d40 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/sbin +usr/lib/magician diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..a36e515 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +amd64/2.02/README.TXT diff --git a/debian/magician.wrapper b/debian/magician.wrapper new file mode 100644 index 0000000..c1af50b --- /dev/null +++ b/debian/magician.wrapper @@ -0,0 +1,4 @@ +#!/bin/sh +LD_LIBRARY_PATH=/usr/lib/magician:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH +exec /usr/lib/magician/magician $@ \ No newline at end of file diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..abbf45a --- /dev/null +++ b/debian/postinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ -f "/usr/lib/magician/magician-2.00" ]; then + update-alternatives --install /usr/lib/magician/magician magician /usr/lib/magician/magician-2.00 200 +fi +if [ -f "/usr/lib/magician/magician-1.00" ]; then + update-alternatives --install /usr/lib/magician/magician magician /usr/lib/magician/magician-1.00 100 +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..ef47142 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,14 @@ +#! /bin/sh + +set -e + +if [ -f "/usr/lib/magician/magician-2.00" ]; then + update-alternatives --remove magician /usr/lib/magician/magician-2.00 +fi +if [ -f "/usr/lib/magician/magician-1.00" ]; then + update-alternatives --remove magician /usr/lib/magician/magician-1.00 +fi + +#DEBHELPER# + +exit 0 \ No newline at end of file diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..020ce6f --- /dev/null +++ b/debian/rules @@ -0,0 +1,52 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +clean: + dh_testdir + dh_testroot + dh_clean + +install: + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs +ifeq ($(DEB_BUILD_ARCH),amd64) + install -D -m 0755 debian/magician.wrapper \ + debian/magician/usr/sbin/magician + install -D -m 0755 amd64/2.00/magician \ + debian/magician/usr/lib/magician/magician-2.00 + install -D -m 0755 amd64/1.00/magician \ + debian/magician/usr/lib/magician/magician-1.00 +endif +ifeq ($(DEB_BUILD_ARCH),i386) + install -D -m 0755 debian/magician.wrapper \ + debian/magician/usr/sbin/magician + install -D -m 0755 i386/2.00/magician \ + debian/magician/usr/lib/magician/magician-2.00 + install -D -m 0755 i386/1.00/magician \ + debian/magician/usr/lib/magician/magician-1.00 +endif + dh_install + +binary-indep: build install +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_link + dh_compress + dh_fixperms + dh_makeshlibs + dh_strip + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install diff --git a/files.diz b/files.diz new file mode 100644 index 0000000..3e8c120 --- /dev/null +++ b/files.diz @@ -0,0 +1,4 @@ +amd64!magician!2.0.0!Samsung_Magician_DC_Linux_64bit.zip!http://www.samsung.com/semiconductor/minisite/ssd/downloads/software/Samsung_Magician_DC_Linux_64bit.zip!07132c95d8bf88fad498fab4b7864b2e!2.00 +i386!magician!2.0.0!Samsung_Magician_DC_Linux_32bit.zip!http://www.samsung.com/semiconductor/minisite/ssd/downloads/software/Samsung_Magician_DC_Linux_32bit.zip!1357224cd841ef97b57c1a489e4f37b4!2.00 +amd64!magician!2.0.0!samsung_magician_dc-v1.0_rtm_p2.tar.gz!http://www.samsung.com/semiconductor/minisite/ssd/downloads/software/samsung_magician_dc-v1.0_rtm_p2.tar.gz!b7e88ecac15adddaa5bfae3f679ee2ca!1.00 +i386!magician!2.0.0!samsung_magician_dc-v1.0_rtm_p2.tar.gz!http://www.samsung.com/semiconductor/minisite/ssd/downloads/software/samsung_magician_dc-v1.0_rtm_p2.tar.gz!b7e88ecac15adddaa5bfae3f679ee2ca!1.00