install :: Flags -> PackageType -> Bool -> Maybe PackageVersionSpecifier -> IO ()
install flags pkgtype subpackage mpvs = do
  stillMissing <- pkgInstallMissing flags mpvs
  unless (null stillMissing) $ do
    putStrLn $ "Missing:" +-+ unwords (map display stillMissing)
    mapM_ cblrpmInstallMissing stillMissing
  mspec <- checkForSpecFile (pvsPackage =<< mpvs)
  case mspec of
    Nothing ->
      withTempDirectory $ \ _ -> do
      spec <- rpmBuild Binary False flags pkgtype subpackage mpvs
      rpmdir <- rpmEval "%{_rpmdir}"
      rpmspec [] (fmap (</> "%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm") rpmdir) spec >>= rpmInstall False
    Just spec -> do
      rpmBuild_ Binary False flags pkgtype subpackage mpvs
      rpmdir <- rpmEval "%{_rpmdir}"
      rpmspec [] (fmap (</> "%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm") rpmdir) spec >>= rpmInstall False
install :: Flags -> PackageType -> Bool -> Maybe PackageVersionSpecifier -> IO ()
install flags pkgtype subpackage mpvs = do
  stillMissing <- pkgInstallMissing flags mpvs
  unless (null stillMissing) $ do
    putStrLn $ "Missing:" +-+ unwords (map display stillMissing)
    mapM_ cblrpmInstallMissing stillMissing
  mspec <- checkForSpecFile (pvsPackage =<< mpvs)
  case mspec of
    Nothing ->
      withTempDirectory $ \ _ -> do
      spec <- rpmBuild Binary False flags pkgtype subpackage mpvs
      rpmdir <- rpmEval "%{_rpmdir}"
      rpmspec [] (fmap (</> "%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm") rpmdir) spec >>= rpmInstall False
    Just spec -> do
      rpmBuild_ Binary False flags pkgtype subpackage mpvs
      rpmdir <- rpmEval "%{_rpmdir}"
      rpmspec [] (fmap (</> "%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm") rpmdir) spec >>= rpmInstall False
install flags pkgtype subpackage mpvs = do
  stillMissing <- pkgInstallMissing flags mpvs
  unless (null stillMissing) $ do
    putStrLn $ "Missing:" +-+ unwords (map display stillMissing)
    mapM_ cblrpmInstallMissing stillMissing
  mspec <- checkForSpecFile (pvsPackage =<< mpvs)
  case mspec of
    Nothing ->
      withTempDirectory $ \ _ -> do
      spec <- rpmBuild Binary False flags pkgtype subpackage mpvs
      rpmdir <- rpmEval "%{_rpmdir}"
      rpmspec [] (fmap (</> "%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm") rpmdir) spec >>= rpmInstall False
    Just spec -> do
      rpmBuild_ Binary False flags pkgtype subpackage mpvs
      rpmdir <- rpmEval "%{_rpmdir}"
      rpmspec [] (fmap (</> "%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm") rpmdir) spec >>= rpmInstall False