[ 
https://jira.codehaus.org/browse/MRPM-4?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=297085#comment-297085
 ] 

hunk huang edited comment on MRPM-4 at 4/24/12 2:40 AM:
--------------------------------------------------------

Andreas's script works beside some small fix. 
{code} 
SETLOCAL
PUSHD .

REM Update buildroot path
FOR /F "tokens=*" %%i in ('cygpath %3') do SET NEW_BUILDROOT=%%i

REM Update topdir path
SET TOPDIR=%5
SET TOPDIR=%TOPDIR:~9,-1%
FOR /F "tokens=*" %%i in ('cygpath "%TOPDIR%"') do SET NEW_TOPDIR=%%i

REM Replace path in spec-file
{color:red}SET OLD_PATH=%TOPDIR:\=\\%
SET NEW_PATH=%NEW_TOPDIR:/=\/%
{color}
sed -s -i -e s/%OLD_PATH%\\/%NEW_PATH%\//g %8

REM Execute rpmbuild
 
bash -c "rpmbuild %1 %2 %NEW_BUILDROOT% %4 ""_topdir %NEW_TOPDIR%"" %6 "%7" 
--define ""_build_name_fmt 
%%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm"" %8"

POPD
ENDLOCAL
{code} 
                
      was (Author: hunkhuang):
    Andreas's script works beside some small fix. 
{code} 
SETLOCAL
PUSHD .

REM Update buildroot path
FOR /F "tokens=*" %%i in ('cygpath %3') do SET NEW_BUILDROOT=%%i

REM Update topdir path
SET TOPDIR=%5
SET TOPDIR=%TOPDIR:~9,-1%
FOR /F "tokens=*" %%i in ('cygpath "%TOPDIR%"') do SET NEW_TOPDIR=%%i

REM Replace path in spec-file
{quote}SET OLD_PATH=%TOPDIR:\=\\%
{quote}SET NEW_PATH=%NEW_TOPDIR:/=\/%

sed -s -i -e s/%OLD_PATH%\\/%NEW_PATH%\//g %8

REM Execute rpmbuild
 
bash -c "rpmbuild %1 %2 %NEW_BUILDROOT% %4 ""_topdir %NEW_TOPDIR%"" %6 "%7" 
--define ""_build_name_fmt 
%%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm"" %8"

POPD
ENDLOCAL
{code} 
                  
> rpm-maven-plugin should work under windows / cygwin
> ---------------------------------------------------
>
>                 Key: MRPM-4
>                 URL: https://jira.codehaus.org/browse/MRPM-4
>             Project: Mojo RPM Plugin
>          Issue Type: Bug
>          Components: rpm
>         Environment: windows xp / cygwin
>            Reporter: Jan Rudert
>         Attachments: rpmbuild.bat
>
>
> Hi there,
> I encountered the following problem while trying to build an rpm under cygwin 
> environment using the 2.0-beta-1 rpm-maven-plugin.
> [WARNING] Der Befehl "rpmbuild" ist entweder falsch geschrieben oder
> [WARNING] konnte nicht gefunden werden.
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] RPM build execution returned: '1'.
> [INFO] 
> ------------------------------------------------------------------------
> This means that the rpmbuild executable was not found. I installed the cygwin 
> rpm packages. Directly calling "rpmbuild" from cygwin commandline works, but 
> the rpm plugin seems to use the windows command shells, which unfortunately 
> does not manage to resolve the file link:
> lrwxrwxrwx   1 rudi   Benutzer      15 Feb 25 17:48 rpmbuild -> 
> ../lib/rpm/rpmb
> So i took the rpmb, put it to the cygwin/bin directory and renamed it to 
> rpmbuild, which is dirty. But then the plugin goes on.
> But then the plugin does not resolve the directories within the mappings 
> correctly:
> [INFO] Building target platforms: noarch
> [INFO] Building for target noarch
> [INFO] Processing files: $rpm-name
> [WARNING] error: File not found: 
> /C:\tmp\place-deploy\deploy\rpm\buildroot/websoft_firstlife/etc
> [WARNING] error: File not found: 
> /C:\tmp\place-deploy\deploy\rpm\buildroot/websoft_firstlife/contrib
> [WARNING] [INFO]
> [INFO]
> [INFO] RPM build errors:
> error: File not found: 
> /C:\tmp\place-deploy\deploy\rpm\buildroot/websoft_firstlife/sbin
> [WARNING] error: File not found: 
> /C:\tmp\place-deploy\deploy\rpm\buildroot/websoft/htdocs
> [WARNING] error: File not found: 
> /C:\tmp\place-deploy\deploy\rpm\buildroot/websoft/htdocs.apache
> [WARNING]     File not found: 
> /C:\tmp\place-deploy\deploy\rpm\buildroot/websoft/etc
> [WARNING]     File not found: 
> /C:\tmp\place-deploy\deploy\rpm\buildroot/websoft/contrib
> [WARNING]     File not found: 
> /C:\tmp\place-deploy\deploy\rpm\buildroot/websoft/sbin
> [WARNING]     File not found: 
> /C:\tmp\place-deploy\deploy\rpm\buildroot/websoft/htdocs
> [WARNING]     File not found: 
> /C:\tmp\place-deploy\deploy\rpm\buildroot/websoft/htdocs.apache
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] RPM build execution returned: '1'.
> one of the mappings looks like this:
>                 <mapping> 
>                   <directory>websoft/contrib</directory>  
>                   <filemode>764</filemode>  
>                   <username>${user}</username>  
>                   <groupname>${group}</groupname>  
>                   <configuration>true</configuration>  
>                   <sources> 
>                     <source> 
>                       <location>work/contrib</location> 
>                     </source> 
>                   </sources> 
>                 </mapping>  
> So we have two issues which block me building rpm's on windows/cygwin. Plz 
> help.
> Thank you
> Jan Rudert

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to