How do you use rpmbuild to make an rpm package when there are file not found or permission errors?

318

This error:

error: File not found: /root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget

means that you specified this file in %files section:

%files
/usr/local/bin/wget

so rpmbuild is expecting this file in $RPM_BUILD_ROOT/usr/local/bin/wget path but it is not there. Therefore this error. Vice versa for the man page.

You can run rpmbuild -bi which will stop just after %install phase and you can check the content of /root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/ where the make install actually put the files.

I guess that either

%install
make install prefix=$RPM_BUILD_ROOT/usr/local

or

%files
%defattr(-,root,root)
/usr/bin/wget
%doc %attr(0444,root,root) /usr/share/man/man1/wget.1

will fix your error. (just one of those!)

Share:
318

Related videos on Youtube

miechooy
Author by

miechooy

Updated on September 18, 2022

Comments

  • miechooy
    miechooy over 1 year

    I am working with WPF application using MaterialDesign for WPF. I have created MainWindow which contains navigation drawer. Here is the XAML of MainWindow:

    <materialDesign:DialogHost>
        <materialDesign:DrawerHost IsLeftDrawerOpen="{Binding IsChecked, ElementName=MenuToggleButton}">
            <materialDesign:DrawerHost.LeftDrawerContent>
            <!--Drawer content-->
            </materialDesign:DrawerHost.LeftDrawerContent>
    
            <!-- Here is my Content-->
            <ContentControl Name="ContentControl"/>
        </materialDesign:DrawerHost>
    </materialDesign:DialogHost>
    

    In the ViewModel of MainWindow I added OnMenuItemSelected method which will set new content to ContentControl as below:

    public void OnMenuItemSelected(object menuItem)
    {
        var itemName = (DrawerMenuItem)menuItem;
        switch (itemName)
        {
            case DrawerMenuItem.Home:
                var window = new ProceduresWindow();
                _contentControl.Content = window.Content;
                break;
            //others
        }
    }
    

    In above example when I click Home button in drawer content of ContentControl should be replace with another Window in this example ProcedureWindow. New ProcedureWindow has DataContext set in XAML as below:

     <Window.DataContext>
            <windows:ProceduresViewModel></windows:ProceduresViewModel>
      </Window.DataContext>
    

    Content is replacing correct but ViewModel is not working. Anyone know how can I solve that?

    • thrig
      thrig over 6 years
      hard to say without seeing the contents of your wget.spec where did that file come from and how did you modify it?