[Solved] Proper/Preferred Way to Install a Directory into $pkgdir?

I'm wondering if there are any guidelines on installing directories from an unpacked RPM into my $pkgdir. From what I've seen, it's typically frowned upon to use cp/mv, but install doesn't seem to have an option to recursively copy a directory. Is my current PKGBUILD okay, or should I be using a different command in place of "cp -r"? Thanks!
My current PKGBUILD looks like this:
# Contributor: Trevor Turner <turn3r [dot] tr3v0r [at] gmail [dot] com>
_i686rpm=hpasm-7.7.0-115.sles9.i586.rpm
_x86_64rpm=hpasm-7.7.0-115.sles9.x86_64.rpm
pkgname=hpasm
pkgver=7.7.0_115
pkgrel=1
pkgdesc="HP Proliant Server Management Agents and Utilities"
arch=('i686' 'x86_64')
url="ftp://ftp.compaq.com/pub/products/servers/supportsoftware/linux/"
license=('custom')
makedepends=('rpmextract')
source=('hpasmd' 'hpasmd.service')
md5sums=('4efbcaf99d2ad688d5887dd28d48854f' '3249472c2ca273d8c348b8daf0ffd996')
if [ "${CARCH}" = "x86_64" ]; then
source+=(ftp://ftp.compaq.com/pub/products/servers/supportsoftware/linux/${_x86_64rpm})
md5sums+=('812416e7ee25690d55389b1df1b549bb')
noextract=("${_x86_64rpm}")
elif [ "${CARCH}" = "i686" ]; then
source+=(ftp://ftp.compaq.com/pub/products/servers/supportsoftware/linux/${_i686rpm})
md5sums+=('420e886d6a66eb6cb3fd0671635519ec')
noextract=("${_i686rpm}")
fi
package() {
cd "$srcdir"
msg2 "Extracting RPM..."
rpmextract.sh *.rpm
msg2 "Installing Files..."
install -dm 755 "${pkgdir}/usr/lib/systemd/system"
install -dm 755 "${pkgdir}/usr/sbin"
install -dm 755 "${pkgdir}/etc/rc.d"
install -Dm 755 "${srcdir}/hpasmd" "${pkgdir}/etc/rc.d/hpasmd"
install -Dm 755 "${srcdir}/hpasmd.service" "${pkgdir}/usr/lib/systemd/system/hpasmd.service"
install -Dm 755 "${srcdir}/sbin/bootcfg" "${pkgdir}/usr/sbin/bootcfg"
install -Dm 755 "${srcdir}/sbin/hpasmcli" "${pkgdir}/usr/sbin/hpasmcli"
install -Dm 755 "${srcdir}/sbin/hplog" "${pkgdir}/usr/sbin/hplog"
install -Dm 755 "${srcdir}/sbin/hpuid" "${pkgdir}/usr/sbin/hpuid"
cp -r "${srcdir}/opt" "${pkgdir}/"
ln -s "/opt/compaq/hpasmd/bin/hpasmd" "${pkgdir}/usr/sbin/hpasmd"
ln -s "/opt/compaq/hpasm/addon/libhpasmintrfc.so.1.0" "${pkgdir}/usr/lib/libhpasmintrfc.so.1.0"
ln -s "libhpasmintrfc.so.1.0" "${pkgdir}/usr/lib/libhpasmintrfc.so.1"
ln -s "/opt/compaq/hpasm/addon/libhpev.so.1.0" "${pkgdir}/usr/lib/libhpev.so.1.0"
ln -s "libhpev.so.1.0" "${pkgdir}/usr/lib/libhpev.so.1"
Last edited by DarkSniper (2012-07-11 00:20:01)

cp is tolerated, but make sure that you manually set permissions if necessary.
Otherwise, create your own functions and paste them in sparingly, e.g.
function install_dir()
src_dir_="${1%/}"
shift
dst_dir_="${1%/}"
shift
src_len_=${#src_dir_}
find "$src_dir_" -type f -print | while read path_
do
rel_path_="${path_:${src_len_}}"
install "$@" "$path_" "$dst_dir$rel_path_"
done
install_dir "$srcdir/$pkgname-$pkgver/foo/lib" "$pkgdir/lib" -Dm 644

Similar Messages

  • [solved] Preferred way to install & update Gnome extensions

    Hello there,
    What is the preferred way to install and update Gnome extensions?
    Do you
    a) install the respective extensions from the AUR
    b) or do you use the https://extensions.gnome.org/local/ page for that purpose?
    What are the advantages and disadvantages of both ways?
    Thanks!
    Last edited by orschiro (2013-06-13 10:10:48)

    Unia wrote:
    Thaodan wrote:Why add an extra interface if your package manager already does the job?
    Because if you use the AUR, you depend on the respective maintainers to update their PKGBUILD when a newer version is out. If they don't update, you will not receive a notification that a newer version of your extension is available.
    With extensions.gnome.org/local, you do not depend on anyone else. It has no harm to your system to manage extensions like this; they get installed for just your user (in $HOME/.local/share/gnome-shell/extensions).
    I know which method I prefer.
    Hmm true, despite the bad effects of using the AUR prefer to use it cause I don't like to add extra interfaces for every app. But I think that is just an opinion...

  • Best way to install Custom Effect into PresetEffects.xml on Mac?

    Hi!
    Can you advise me please the best and "proper" way to install (inject) my part of xml on Mac OS please?
    In the best occasion - by Apple Script.
    At this moment I made C++ based .exe installer, who reading the AE placement from Windows' registry and injecting a part of .xml text inside of PresetEffects.xml in folder .../Adobe After Effects CC/Support Files/
    I would do similar in Mac now...
    Thank you in advance!

    When I say that a feature is "not supported", I mean that neither I nor any other Adobe person should be assisting you in doing this. Modifying the preset effects XML file is not something that users are supposed to do. It is untested, unsupported, undocumented, and not recommended.

  • [Solved] 'Best' way to install programs?

    I was wondering what the arch Linux community thought the best way to install things is.
    I was wondering if compiling things from source would be better in some cases then using Pacman, I'm sure I read that you prefer people to install from source, when I was reading the tex live wiki. Now I could have been wrong, read something wrong or just not understood.
    I'm sure this makes the program faster, and makes me be able to install them to my every need, but then is updating and keeping them up to date problematic? Should I install OpenGL and mesa from source, and leave the rest like Firefox to Pacman?
    I am new to Linux, and haven't compiled anything from source, and would like to know how to.
    Last edited by Peilonrayz (2014-06-21 12:03:57)

    Peilonrayz wrote:
    There are two good ways to install TeX Live. One is to use pacman. The other is to use the upstream installer.
    Can you please show me what you are referring to?
    I didn't know about the TeX having it's own installer, it's just as I read this when I was installing it last time: `Installing TeX Live manually honors the Arch Way in that it gives you much more control and lets you understand the process.`
    After being told about PKGBUILD, this makes much more sense as I read it as compile from source, rather then alternate ways like this.
    The 'install manually' is referring to using upstream's installer. It is not talking about compiling the binaries from source.
    For details of the options offered by upstream, see http://www.tug.org/texlive/. If you have a reasonable network connection and are not planning to install on more than a couple of machines, the network installer is probably the best option. The 'quick installation' instructions are useful but you will want to refer to parts of the full installation documentation as well if doing this for the first time.
    I recommend accepting upstream's defaults for the most part. In particular, I recommend using the 'full' installation scheme unless you are short of disk space.
    I also recommend *not* installing as root. This is also in line with upstream's recommendation. What I did was create a new user and group (texlive:texlive). As root, I also created the directory /usr/local/texlive and made sure it was owned by the texlive user. Then I logged in as that user to install. This works well. Neither the installer nor later use of the utilities can touch your home directory or system files. There is no downside to this - it is no less convenient than having the installation owned by root. So you gain a security benefit for no cost. (Or minimal cost: you have to create a single user and group, make one new directory and chmod that directory appropriately.)
    # adjust options as desired
    useradd -d /usr/local/texlive -m -g texlive -r -s /bin/sh texlive
    Set a password for the new account, and check ownership and permissions on the new directory:
    drwxr-xr-x 7 texlive texlive 4.0K Meh 26 02:14 .
    Then log in as texlive and install.

  • Proper way to install windows update on Exchange 2010 DAG with one mailbox server in Head Office and 1 mailbox server in DR site both are members of 1 DAG

    Hi Guyz,
    I have this setup in my exchange environment.
    1 DAG with 2 members
    - One member is located in Head Office and the other member is located in DR site. All of the mailbox databases are located only in HO (Plan to add additional second member in HO soon). Now what is the proper way to install windows patches on the
    member in HO? I don't want to move the databases to DR site as much as possible.
    Appreciate your feedback and Many thanks in advance guyz..
    More power to all!
    Regards,

    Hi,
    To update the DAG members with new patches, the update process should be managed to prevent all of the DAG members from being offline at the same time.
    To do this, I recommend you move the active mailbox databases off a particular server so that it can be patched, and if necessary rebooted, without causing any downtime for mailbox users on that database.
    For detailed steps, here is an article for your reference.
    How to Install Updates on Exchange Server 2010 Database Availability Groups
    http://exchangeserverpro.com/how-to-install-updates-on-exchange-server-2010-database-availability-groups/
    Note: Microsoft is providing this information as a convenience to you. The site is not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make
    sure that you completely understand the risk before retrieving any suggestions from the above link.
    Hope it helps.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Proper way to install ADF Runtime in Stand Alone weblogic 10.3.3.0

    Hello:
    I found several different methods to install ADF Runtime in a stand alone weblogic server 10.3.3.0. and they seem to be very different.
    Does anyone know the official Oracle way to install the ADF Runtime or specific reference to this in the docs? The goal is to make a simple ADF web app, and get it working on a stand alone weblogic server.
    Thanks for looking at this post.
    Don

    You can either use the installer that comes with JDeveloper or the one that comes with the application developer installer for WebLogic.
    Info here:
    http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/deployment_topics.htm#CHDCDAIE

  • Is there a way to delete a directory with files in it?

    I am working on a program right now, and i need to know if there is a way to delete a directory that has files in it?
    or do i have to write another program that gets the list and deletes each file individually? if this is the solution, how do you do this?
    Right now, i would prefer some of the logic and some "code snippets" but please do not write the entire code out for me.
    thank you.
    (snippets include how to poll, and how to call the polled item so i can delete it...)

    Right now, i would prefer some of the logic andsome "code snippets" but
    please do not write the entire code out for me.So I assume this is some sort of "homework" (maybe
    self imposed).
    You can't use File's delete() to delete a non empty
    directory as I guess you
    have discovered. So basically, yes, you have delete
    each child file
    separately and then delete the directory.
    But it gets worse. The directory may itself contain
    directories and these may
    not be empty...
    There's a fairly extensive snippet here:
    http://www.exampledepot.com/egs/java.io/TraverseTree.h
    tml which shows
    how you can "visit" every file and folder inside a
    given folder (children,
    grandchildren etc) and "process" them. It may help -
    but be warned there's
    a nearby example which more or less solves your
    problem.Um, did my post above get covered with lemon juice or otherwise become invisible?
    Jakarta Commons IO FileUtils already does the job.

  • I just migrate settings and software from my PowerBook to a new Mac Pro. All the software download from CC is there and working, except for CC, and there is not way to install.

    I just migrate settings and software, include CC, from my PowerBook to a new Mac Pro. All the software download from CC is there and working, except for CC, and there is not way to install. I have try because every time I restar keep bothering asking for installation, (by the way, the link is not up to date). Will appreciate your help.

    never migrate adobe software.  it should be properly installed.
    uninstall all the cc programs you can, clean and then reinstall per, Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6

  • Best way to install a new hard drive into a laptop?

    what's the proper way to install a new hard drive into a laptop? i've heard that cloning can result in very slow boot up and shut down times, and that the proper method is install the new hard drive, install OSX, and restore data from time machine. comments? thanks very much

    Cloning doesn't cause the resulting system to slow down in and of itself, but it does retain any previous problems, which can build up over time and result in poor performance. (The same can be said of installing new system versions on top of old versions.)
    A clean OS X installation will give you a clean base to start from. Mass-restoring data and applications will undo some of that benefit, but by no means all.

  • Best way to install a photosmart 5180 on new 8.1

    What's the best way to install a Photosmart 5180 on a new 8.1 pc? I have the disc, but I don't think it'll work. Should I download the software and hook it up via USB cable or wireless. The pc is wireless, and I tried to find the printer on the network, but no luck.
    suggestions? 
    This question was solved.
    View Solution.

    Hi,
    I can't re-create your error. I've got NO problem at all:
    All I can say.: please download again, save it on desktop and run it from there.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Is there any way to install OS without USB Cable?

    Is there any way to install coroupted OS of z10 with USB cable? Actually my phones USB point is not working and OS is coroupted. IS THERE ANY WAY TO REINSTALL IT?

    At
    Navigate to Start -> Control Panel -> Device Manager -> Network Adapters.
    What do you see?
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Best way to install oracle server + odp on same machine

    Hello,
    I've been having problems with this configuration:
    Win 2003 x64 R2
    + IIS Server
    + Oracle DataBase 10g Release 2 102010_win64_x64_database
    + 10.2.02 patchset Win2003 x64
    + ODAC 10.2.02 x64 Beta
    So far, I've installed all in the same Oracle_home.
    I get an ORA-12154 "TNS:could not resolve service name" error when running my ASP .NET application.
    Been reading in the Knowledge Base and found that there where some issues with access to bin directories from ASP applications. Tried to solve it that way but couldn't make it work.
    I'm reinstalling now, and I'm wondering if it's better to install ODP on a different ORACLE_HOME...
    Any advice?
    Thanks for your help.

    On web.config you can find this line:
    <add assembly="Oracle.DataAccess, Version=2.102.2.20, Culture=neutral,
    PublicKeyToken=89B483F429C47342"/>
    I could change this version to the one on my GAC but i cannot change the
    version inside one of the DLLs of our app.There's 2 ways to reference an assembly. One is to use web.config, which is specific to ASP.NET. When you add a reference in the VS IDE, it will create this entry in web.config for you. Or, you can hand-edit the file to create it. Of course, you might get an entry like this "by accident" if you copy from somebody else's code example.
    For library, console, Win Forms, and all other project types except ASP.NET, a reference placed within the IDE will create metadata in the assembly's manifest area.
    In all cases, you should only put a reference on the specific Oracle assembly you want to use. If the manifest or web.config are wrong, it means you referenced the wrong assembly. The manifest of an assembly can be viewed with ildasm.
    You need to be anal about developing with the same exact assemblies as the ones you will deploy with.
    Sometimes Oracle will add a "binding redirect" assemblies with new updates, and this forces all pre-existing programs to automatically use the new assemblies. I personally would like to see them document this better. This can cause a great deal of confusion because it can cause production programs to use newer assemblies than the ones you developed with. In most cases, we hope this is fine. But it flies in the face of "side-by-side" deployment and invalidates one of the key advantages of .NET.
    Eric

  • What is the correct way to install Leopard?

    It seems like everytime I upgrade to a new OS, I end up screwing something up. I am borderline thinking about taking my laptop up to the apple store and having them install Leopard for me. Last week in another thread someone posted something saying I should backup my home directory? and save it to my external drive then install leopard and then drag that home directory back over. This was said to be a work around instead of using Archive and Install. I guess I could do that but are there other suggestions out there?
    I just don't want to happen what happened when I installed Leopard on my desktop. I had about 4 libraries of stuff and another folder that was marked Previous system and that had a bunch of files and then I had the home directory for the old system! The bottom line I had a lot of stuff that I ended up deleting which freed up my hard drive space significantly.
    I would like to make the install on my Macbook Pro clean, simple and painless as possible!
    Thanks!
    Oh yea if I decide to back up the home directory. Do I just drag the little house icon over to my external drive? If so, once Leopard is installed, do I drag it back to the same location I took it from?

    If you don't mind reinstalling all your applications, backup your home folder to an external, boot off your Leopard Disk and go to Disk Utility. Erase your hard drive and format HFS+. Than do an Erase & Install. After that is complete, restart. Once you go through the setup procedures, perform all the software updates until they are all installed. Now move your Home Directory back. Finally, start reinstalling your applications. This will give you a brand new Leopard system that should work fine.
    First however, make a bootable clone of your HD to an external drive for backup. You need to erase the drive and format to HFS+ with a GUID partition table. Use Carbon Copy Cloner to make the clone.
    To back up the home folder, yes, drag the little house icon to an external, but with the bootable clone, this isn't really neccesary.
    This isn't the easiest way to install Leopard, but it gives you the best chance of having no issues.

  • What is the proper way to insert an envelope into a hp9680?

    What is the proper way to put an envelope into a HP 6980?

    Hi,
    Normally th software (driver) will shows you how to feed tha envelop for example like this.
    Regards
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Correct way to install new MotherBoard?

    What's the correct way to install a new MB?
    Do I format first, unhook the old stuff and hook up the new then install windows?
    Thanks for the time.

    Please read this - Moan Guide
    Please create a signature of your current system (if you have one!!!) or else of the individual parts you wish to assemble.
    When first building a new system it is always preferable to start afresh with clean hard drives, and a fresh OS install.
    However, if you already have a system up and running and you are just upgrading the motherboard, then it is possible to keep an existing OS + data installation and update the relevant drivers.
    IMHO, unless I had some VERY precious data and no other way of storing it whilst updating, I would start with a newly formatted hard drive and a fresh OS installation.

Maybe you are looking for

  • Can no longer download pdf file since last safari update

    Since the last OS update (I am running Safari 6.1; OX 10.8.5) pdf files via Safari fail to open. Yet they do open in Firefox, which is 'not' my default browser. Anyone else having issues?

  • Guide to installing XE and Apex on Oracle Enterprise Linux 5.3 (64 bit)

    I have just been through a time consuming and frustrating process of installing Oracle XE 10gR2 on Oracle Enterprise Linux 5.3 x86-64 and I want to share my experience so that others can benefit from it and overcome the same problems more quickly. Pr

  • Time Machine Back Up to WD My Book Stopped Working

    I use Time Machine to Backup my iMac (OS X 10.6.6) to an external WD My Book. Suddenly all backups seem to complete, no error is shown, but the latest backup remains January 13, 2011. I am able to open Time Machine and see the January 13 backup and t

  • Trigger not found after import

    Hello, I copied couple of schemas from one database to another using exp and imp. Both my source and destination databases are 9.2.0.0.7. Everything loaded correctly; however, when I issue the 'alter trigger ... compile' command on those invalid obje

  • Bidirectional NLS support in web-enabled forms.

    Is it possible to have bidirectional NLS support in web-enabled forms? That is, can a local user make any settings changes on their workstation that will make (e.g.) Hebrew right-justified for text fields? If this all depends on the environment varib